WordPress

Create Better SEO By Removing Stop Words

Search engines will not index common words this is so it can save time on both crawling and indexing. There are so many words which are always used it's a waste of time to index them.

Words such as

  • a
  • and
  • her
  • him
  • how
  • is
  • isn't
  • thanks
  • I
  • make
  • want

These words are known as SEO Stop words, as these words are not indexed is there any reason for them to be included in your URL.

If you use WordPress your post will automatically create the URL slug for your post, therefore we can add a function to stop your WordPress blog from having these stop words in your URL.

Add the following code snippet to your functions.php file to stop your URLs from including these words.

add_filter('sanitize_title', 'remove_stop_words');

function remove_stop_words($slug) {    

if (!is_admin()) return $slug;    

$slug = explode('-', $slug);    

foreach ($slug as $k => $word) {
        // List of stop words comma separated
	$keys = explode( ',', "a,about,above,after,again,against,all,am,an,and,any,are,aren't,as,at,be,because,been,before,being,below,between,both,but,by,can't,cannot,could,couldn't,did,didn't,do,does,doesn't,doing,don't,down,during,each,few,for,from,further,had,hadn't,has,hasn't,have,haven't,having,he,he'd,he'll,he's,her,here,here's,hers,herself,him,himself,his,how,how's,i,i'd,i'll,i'm,i've,if,in,into,is,isn't,it,it's,its,itself,let's,me,more,most,mustn't,my,myself,no,nor,not,of,off,on,once,only,or,other,ought,our,ours,ourselves,out,over,own,same,shan't,she,she'd,she'll,she's,should,shouldn't,so,some,such,than,that,that's,the,their,theirs,them,themselves,then,there,there's,these,they,they'd,they'll,they're,they've,this,those,through,to,too,under,until,up,very,was,wasn't,we,we'd,we'll,we're,we've,were,weren't,what,what's,when,when's,where,where's,which,while,who,who's,whom,why,why's,with,won't,would,wouldn't,you,you'd,you'll,you're,you've,your,yours,yourself,yourselves");		

        foreach ($keys as $l => $wordfalse) {			
              if ($word==$wordfalse) {				
                    unset($slug[$k]);			
              }		
        }    
}    

return implode('-', $slug);}

To get a full list of stop words view this page.

Back to top ^

Comments

  1. Can I just remove them manually each time by editing the permalink? I only post once a week so it's not a big deal to do so.

    1. Paul says:

      Yes of course you can do this manually. Or using a plugin like Yoast SEO will do this for you on publish.

Join Paulund

  • Access 100s of premium tutorials and downloadable content
  • Members content consists of premium WordPress plugins, CSS packages, jQuery packages, tutorial demo files and templates for 100s of web development tutorials
  • In-depth development tutorials
  • Priority tutorial requests
  • No ads

Join Paulund