how to disable stopword filtering of URLs in wordpress seo plugin

There are many different WordPress plugin that help you with the SEO of your website or blog. There are some that handle just one part of the SEO such as meta tags or description and then there are other which takes an all in one approach to SEO. WordPress SEO by Yoast is one of the plugins that I use on this blog, that manages much of the different SEO factors and also provides a good content analysis feature.

One of the features that WordPress SEO plugin has is the ability rewrite the post URLs (or permalinks) to better conform to best practice SEO guidelines. It uses a predefined set of stopwords and rewrites the default URL by eliminating the stopwords in the URL.

Stopwords is the term used to denote a set of words that are considered immaterial to the search engine indexing and ranking. These contain words such as a, an, in, the, is, at etc among many others. These words are removed while indexing by some or all search engines and are not believed to have no effect on the ranking.

Having said that, I am not a big proponent of stopword removal from the URL or the title or any text for that matter. There are some reasons for this, some of which you might agree with and maybe some not so much.

  • There are no predefined set of stopwords that is shared by everybody, ie plugins, search engines and text analyzers etc. This means that even though there are very many overlaps between these sets, there is really no good way to know which one is being used specifically.
  • It is hard to believe that there is any negative effects on SEO by simply using stopwords. At best, it is has no effect and is neutral.
  • Using stopwords means you are writing for the human reader rather than a search engine parser, which is what search engines like Google recommend anyways.
  • Stopwords do provide some semantic information even within the phrases. It is very much plausible that search engines will incorporate more semantic parsing going forward when the stopwords might actually be helpful.
  • There is a possibility that search queries with stopwords in them will match better with URLs that contain the exact phrase, with stopword and all.

So coming back to the plugin, unfortunately there is no configuration option turn this feature off (or on) in the plugin settings. Depending on the nature of the website and the particular blog post itself, you might want to keep the stopwords in the URL.

Workaround

You can get the plugin to “think” that you have manually overridden and set the URL. This will actually cause the plugin to not overwrite it again. In order to do so, click on the Permalink in order edit the link manually or click on the Edit button next to it. Then make a small change somewhere and click OK.

This should cause the URL to stick most of the time. Click on Save Draft to verify that the URL is not being changed. In case it does not work, Click edit again and repeat the process.

Turn it Off (in the code)

Having to remember the workaround every single time is a hassle, so we need to make it permanent. This is simple enough that you can actually do it from the WordPress admin interface, even though you will need to use the textarea editor.

  1. In WordPress Admin Dashboard, Click on Plugins
  2. In submenu, Click on Editor to open textarea editor
  3. Click on the dropdown on the top right hand side of the screen and select WordPress SEO as the plugin to edit
  4. Click on the Select button, which will display all the files of the plugin
  5. On the right side column under Plugin Files, Select wordpress-seo/admin/class-admin.php file. The file content will be displayed inside the text area.
  6. Scroll down the file and find function remove_stopwords_from_slug( $slug )
  7. Inside the function, look for the line of code which looks like : $clean_slug_array = array_diff( explode( ‘-‘, $clean_slug ), $this->stopwords() );
  8. Make the change in the code as shown below. ie. Replace $this->stopwords()  with array()
  9. Click Update File button to save changes

Old Code: $clean_slug_array = array_diff( explode( '-', $clean_slug ), $this->stopwords() );

to

New Code: $clean_slug_array = array_diff( explode( '-', $clean_slug ), array() );

Plugin editor in WordPress

You should now be able to use the WordPress SEO plugin along with the default WordPress generated URL. This is not to say that a option to disable the feature will not appear in the future releases of the plugin. This was written as of the plugin version 1.4.15. If you are using a later version, then make sure that the disable option is not already provided.