{"id":361,"date":"2013-12-10T09:56:43","date_gmt":"2013-12-10T09:56:43","guid":{"rendered":"http:\/\/www.seoreviewtools.com\/?p=361"},"modified":"2018-01-04T09:05:05","modified_gmt":"2018-01-04T09:05:05","slug":"multi-keyword-density-checker-php-script","status":"publish","type":"post","link":"https:\/\/www.seoreviewtools.com\/multi-keyword-density-checker-php-script\/","title":{"rendered":"Multi keyword density checker PHP script v1"},"content":{"rendered":"<h2>Keyword density.<\/h2>\n<p>Keyword density is used to determine the number of times a keyword or keyword phrase occurs on a web page \/ section of content compared to the total number of words found. Many of us are not convinced keyword density is a very important metric for search engines. This is also my personal opinion, but on the other hand it can be used to find interesting insights. So I\u2019ve decided to make this piece of code publicly available. Like to see this code in action? Have a look at the <a href=\"http:\/\/www.seoreviewtools.com\/keyword-density-checker\/\">Keyword density Checker<\/a>.<\/p>\n<h2>About the PHP script<\/h2>\n<ul>\n<li>Extracting content from a web page &#8211; Currently the script is able to process a string of words.<\/li>\n<li>Stop Words &#8211; You can add expand the list of stop words with relevant words for your language, just do a quick search on <a href=\"https:\/\/www.google.com\/search?q=stop+words&amp;oq=stop+words\">Google<\/a>.<\/li>\n<li>Function &#8211; This code makes use of a function. This isn\u2019t strictly necessary, but for future purposes I think it\u2019s convenient.<\/li>\n<li>Generating output &#8211; The current code outputs tables using separate foreach loops. You can tinker with it and make it a little more dynamic. But for now I think it\u2019s a good solution to make the code accessible and not over complicated.<\/li>\n<\/ul>\n<h2>To do list (future versions)<\/h2>\n<ul>\n<li>Extracting content from a page<\/li>\n<li>Create a more advanced filter to remove non relevant (reading) characters, so they don\u2019t mess with the output.<\/li>\n<li>Your suggestions\u2026!<\/li>\n<\/ul>\n<h2>Current version V1<\/h2>\n<p>This isn\u2019t the final version! When i\u2019ve got some spare time I\u2019ll work on the code and add the above features. In the meantime have fun with the code and check this page for future releases and updates.<\/p>\n<h2>Keyword density checker PHP script<\/h2>\n<p><strong><a href=\"http:\/\/www.seoreviewtools.com\/downloads\/MultiKeywordDensityChecker.zip\">Download the Multi Keyword density checker PHP script<\/a><\/strong><\/p>\n<h2>Function output<\/h2>\n<p>Sample of the <em>keywordSorting\u00a0<\/em>function. In bold you can find the explanation. <div id=\"attachment_369\" style=\"width: 321px\" class=\"wp-caption alignnone\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-369\" class=\"size-full wp-image-369\" src=\"http:\/\/www.seoreviewtools.com\/wp-content\/uploads\/keyword-density-array.png\" alt=\"keyword density array\" width=\"311\" height=\"378\" srcset=\"https:\/\/www.seoreviewtools.com\/wp-content\/uploads\/keyword-density-array.png 311w, https:\/\/www.seoreviewtools.com\/wp-content\/uploads\/keyword-density-array-246x300.png 246w\" sizes=\"auto, (max-width: 311px) 100vw, 311px\" \/><p id=\"caption-attachment-369\" class=\"wp-caption-text\">keyword density array<\/p><\/div><\/p>\n<h2>Question or suggestions?<\/h2>\n<p>Just let me know&#8230; And I&#8217;ll see what I can do!!<\/p>\n","protected":false},"excerpt":{"rendered":"Keyword density. Keyword density is used to determine the number of times a keyword or keyword phrase occurs on a web page \/ section of content compared to the total number of words found. Many of us are not convinced keyword density is a very important metric for search engines. This is also my personal opinion, but on &#8230;..","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[8],"tags":[],"class_list":["post-361","post","type-post","status-publish","format-standard","hentry","category-php"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.9 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Multi keyword density checker PHP script v1 - SEO Review Tools<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.seoreviewtools.com\/multi-keyword-density-checker-php-script\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Multi keyword density checker PHP script v1 - SEO Review Tools\" \/>\n<meta property=\"og:description\" content=\"Keyword density. Keyword density is used to determine the number of times a keyword or keyword phrase occurs on a web page \/ section of content compared to the total number of words found. Many of us are not convinced keyword density is a very important metric for search engines. This is also my personal opinion, but on .....\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.seoreviewtools.com\/multi-keyword-density-checker-php-script\/\" \/>\n<meta property=\"og:site_name\" content=\"SEO Review Tools\" \/>\n<meta property=\"article:published_time\" content=\"2013-12-10T09:56:43+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2018-01-04T09:05:05+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.seoreviewtools.com\/wp-content\/uploads\/keyword-density-array.png\" \/>\n\t<meta property=\"og:image:width\" content=\"311\" \/>\n\t<meta property=\"og:image:height\" content=\"378\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Jasja ter Horst (admin)\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@SEOReviewTools\" \/>\n<meta name=\"twitter:site\" content=\"@SEOReviewTools\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Jasja ter Horst (admin)\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.seoreviewtools.com\/multi-keyword-density-checker-php-script\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.seoreviewtools.com\/multi-keyword-density-checker-php-script\/\"},\"author\":{\"name\":\"Jasja ter Horst (admin)\",\"@id\":\"https:\/\/www.seoreviewtools.com\/#\/schema\/person\/39703415fe4bc4ab775e9c3a88e485cb\"},\"headline\":\"Multi keyword density checker PHP script v1\",\"datePublished\":\"2013-12-10T09:56:43+00:00\",\"dateModified\":\"2018-01-04T09:05:05+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.seoreviewtools.com\/multi-keyword-density-checker-php-script\/\"},\"wordCount\":341,\"commentCount\":7,\"image\":{\"@id\":\"https:\/\/www.seoreviewtools.com\/multi-keyword-density-checker-php-script\/#primaryimage\"},\"thumbnailUrl\":\"http:\/\/www.seoreviewtools.com\/wp-content\/uploads\/keyword-density-array.png\",\"articleSection\":[\"PHP\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.seoreviewtools.com\/multi-keyword-density-checker-php-script\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.seoreviewtools.com\/multi-keyword-density-checker-php-script\/\",\"url\":\"https:\/\/www.seoreviewtools.com\/multi-keyword-density-checker-php-script\/\",\"name\":\"Multi keyword density checker PHP script v1 - SEO Review Tools\",\"isPartOf\":{\"@id\":\"https:\/\/www.seoreviewtools.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.seoreviewtools.com\/multi-keyword-density-checker-php-script\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.seoreviewtools.com\/multi-keyword-density-checker-php-script\/#primaryimage\"},\"thumbnailUrl\":\"http:\/\/www.seoreviewtools.com\/wp-content\/uploads\/keyword-density-array.png\",\"datePublished\":\"2013-12-10T09:56:43+00:00\",\"dateModified\":\"2018-01-04T09:05:05+00:00\",\"author\":{\"@id\":\"https:\/\/www.seoreviewtools.com\/#\/schema\/person\/39703415fe4bc4ab775e9c3a88e485cb\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.seoreviewtools.com\/multi-keyword-density-checker-php-script\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.seoreviewtools.com\/multi-keyword-density-checker-php-script\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.seoreviewtools.com\/multi-keyword-density-checker-php-script\/#primaryimage\",\"url\":\"https:\/\/www.seoreviewtools.com\/wp-content\/uploads\/keyword-density-array.png\",\"contentUrl\":\"https:\/\/www.seoreviewtools.com\/wp-content\/uploads\/keyword-density-array.png\",\"width\":311,\"height\":378,\"caption\":\"keyword density array\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.seoreviewtools.com\/multi-keyword-density-checker-php-script\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.seoreviewtools.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Multi keyword density checker PHP script v1\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.seoreviewtools.com\/#website\",\"url\":\"https:\/\/www.seoreviewtools.com\/\",\"name\":\"SEO Review Tools\",\"description\":\"Making SEO accessible\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.seoreviewtools.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.seoreviewtools.com\/#\/schema\/person\/39703415fe4bc4ab775e9c3a88e485cb\",\"name\":\"Jasja ter Horst (admin)\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.seoreviewtools.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/bb6e62e3720214b4311a1dd8d0927f75e8ecf14da0f7a8f96fc4a3174ac0dd25?s=96&d=blank&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/bb6e62e3720214b4311a1dd8d0927f75e8ecf14da0f7a8f96fc4a3174ac0dd25?s=96&d=blank&r=g\",\"caption\":\"Jasja ter Horst (admin)\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Multi keyword density checker PHP script v1 - SEO Review Tools","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.seoreviewtools.com\/multi-keyword-density-checker-php-script\/","og_locale":"en_US","og_type":"article","og_title":"Multi keyword density checker PHP script v1 - SEO Review Tools","og_description":"Keyword density. Keyword density is used to determine the number of times a keyword or keyword phrase occurs on a web page \/ section of content compared to the total number of words found. Many of us are not convinced keyword density is a very important metric for search engines. This is also my personal opinion, but on .....","og_url":"https:\/\/www.seoreviewtools.com\/multi-keyword-density-checker-php-script\/","og_site_name":"SEO Review Tools","article_published_time":"2013-12-10T09:56:43+00:00","article_modified_time":"2018-01-04T09:05:05+00:00","og_image":[{"width":311,"height":378,"url":"https:\/\/www.seoreviewtools.com\/wp-content\/uploads\/keyword-density-array.png","type":"image\/png"}],"author":"Jasja ter Horst (admin)","twitter_card":"summary_large_image","twitter_creator":"@SEOReviewTools","twitter_site":"@SEOReviewTools","twitter_misc":{"Written by":"Jasja ter Horst (admin)","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.seoreviewtools.com\/multi-keyword-density-checker-php-script\/#article","isPartOf":{"@id":"https:\/\/www.seoreviewtools.com\/multi-keyword-density-checker-php-script\/"},"author":{"name":"Jasja ter Horst (admin)","@id":"https:\/\/www.seoreviewtools.com\/#\/schema\/person\/39703415fe4bc4ab775e9c3a88e485cb"},"headline":"Multi keyword density checker PHP script v1","datePublished":"2013-12-10T09:56:43+00:00","dateModified":"2018-01-04T09:05:05+00:00","mainEntityOfPage":{"@id":"https:\/\/www.seoreviewtools.com\/multi-keyword-density-checker-php-script\/"},"wordCount":341,"commentCount":7,"image":{"@id":"https:\/\/www.seoreviewtools.com\/multi-keyword-density-checker-php-script\/#primaryimage"},"thumbnailUrl":"http:\/\/www.seoreviewtools.com\/wp-content\/uploads\/keyword-density-array.png","articleSection":["PHP"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.seoreviewtools.com\/multi-keyword-density-checker-php-script\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.seoreviewtools.com\/multi-keyword-density-checker-php-script\/","url":"https:\/\/www.seoreviewtools.com\/multi-keyword-density-checker-php-script\/","name":"Multi keyword density checker PHP script v1 - SEO Review Tools","isPartOf":{"@id":"https:\/\/www.seoreviewtools.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.seoreviewtools.com\/multi-keyword-density-checker-php-script\/#primaryimage"},"image":{"@id":"https:\/\/www.seoreviewtools.com\/multi-keyword-density-checker-php-script\/#primaryimage"},"thumbnailUrl":"http:\/\/www.seoreviewtools.com\/wp-content\/uploads\/keyword-density-array.png","datePublished":"2013-12-10T09:56:43+00:00","dateModified":"2018-01-04T09:05:05+00:00","author":{"@id":"https:\/\/www.seoreviewtools.com\/#\/schema\/person\/39703415fe4bc4ab775e9c3a88e485cb"},"breadcrumb":{"@id":"https:\/\/www.seoreviewtools.com\/multi-keyword-density-checker-php-script\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.seoreviewtools.com\/multi-keyword-density-checker-php-script\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.seoreviewtools.com\/multi-keyword-density-checker-php-script\/#primaryimage","url":"https:\/\/www.seoreviewtools.com\/wp-content\/uploads\/keyword-density-array.png","contentUrl":"https:\/\/www.seoreviewtools.com\/wp-content\/uploads\/keyword-density-array.png","width":311,"height":378,"caption":"keyword density array"},{"@type":"BreadcrumbList","@id":"https:\/\/www.seoreviewtools.com\/multi-keyword-density-checker-php-script\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.seoreviewtools.com\/"},{"@type":"ListItem","position":2,"name":"Multi keyword density checker PHP script v1"}]},{"@type":"WebSite","@id":"https:\/\/www.seoreviewtools.com\/#website","url":"https:\/\/www.seoreviewtools.com\/","name":"SEO Review Tools","description":"Making SEO accessible","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.seoreviewtools.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.seoreviewtools.com\/#\/schema\/person\/39703415fe4bc4ab775e9c3a88e485cb","name":"Jasja ter Horst (admin)","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.seoreviewtools.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/bb6e62e3720214b4311a1dd8d0927f75e8ecf14da0f7a8f96fc4a3174ac0dd25?s=96&d=blank&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/bb6e62e3720214b4311a1dd8d0927f75e8ecf14da0f7a8f96fc4a3174ac0dd25?s=96&d=blank&r=g","caption":"Jasja ter Horst (admin)"}}]}},"views":17928,"_links":{"self":[{"href":"https:\/\/www.seoreviewtools.com\/wp-json\/wp\/v2\/posts\/361","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.seoreviewtools.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.seoreviewtools.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.seoreviewtools.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.seoreviewtools.com\/wp-json\/wp\/v2\/comments?post=361"}],"version-history":[{"count":0,"href":"https:\/\/www.seoreviewtools.com\/wp-json\/wp\/v2\/posts\/361\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.seoreviewtools.com\/wp-json\/wp\/v2\/media?parent=361"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.seoreviewtools.com\/wp-json\/wp\/v2\/categories?post=361"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.seoreviewtools.com\/wp-json\/wp\/v2\/tags?post=361"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}