How To Enable Search Engine Friendly URLs In WordPress

WordPress can be considered one of the most common platforms to host your website on.

Whether it’s a small local business site, a large scale magazine or even an ecommerce store, WordPress provides a convenient way to both setup a site quickly and also easily maintain it.

What are Search Engine Friendly URLs?

By default, WordPress has a standard way of handling articles or posts that you create on your site.  This standard way is to put the post id as a GET parameter to the standard index.php file on your site which is actually the main entry point to your WordPress app.

So if your website was https://www.myawesomesite.com/ you would see your posts appearing as things like:

  • https://www.myawesomesite.com/index.php?p=34
  • https://www.myawesomesite.com/index.php?p=37
  • https://www.myawesomesite.com/index.php?p=42

Which is fine, however just looking at the URLs of those posts, you’ve got no idea what the post is about!

And guess what?

Google (and other search engines) have got no idea too.

Wouldn’t it be better if you could include some keywords about your post in the URL? Something like:

  • https://www.myawesomesite.com/learning-spanish-for-beginners
  • https://www.myawesomesite.com/10-spanish-phrases-you-must-know
  • https://www.myawesomesite.com/visiting-spain

It would not only help the search engine bots but will also give human users a good idea what to expect if they click through to your site.

Enabling Search Engine Friendly URLs in WordPress

Enabling Search Engine Friendly URLs

If you log in to your WordPress admin pages and click on the settings option from the left hand menu you can click the Permalinks option to change how your URLs get displayed on your website.

You can select a variety of options but probably the best and most appropriate option is to set the permalinks, i.e. the URL to be displayed for your posts, to be the post name as set when creating a post.  Select the Post Name option as shown above and then save the settings.

Now you can set the URL of a post you create to be anything you like when you create a new post for your site.

Setting the URL of your WordPress Posts

Now that we’ve set your posts to have their own specific URL, we need to know how to actually set the URL of each individual post.

Setting Search Engine Friendly URLs from WordPress

It’s pretty simple actually.

When creating new posts, just choose to Edit the permalink as shown above.

You can choose anything to be displayed as the URL for your post but generally speaking, shorter URLs matching the title of the post that have the stop words removed is the way to go

Problems?

Probably, the most common problem when setting up Search Engine Friendly URLs in WordPress is a missing .htaccess file.

I won’t go in to the ins and outs of what a .htaccess file is here but suffice to say, you need one to make sure that when a user visits a Search Engine Friendly URL it ends up loading the correct post.

If you’re having problems such as ‘page not found’ or similar when enabling your Search Engine Friendly URLs then it’s likely your hosting is missing a .htaccess file.

The best thing to do is to speak to your hosting provider or if you have FTP or some other access to your hosting account you can add the following content to a file called .htaccess in the root of your web hosting.

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress

This will provide the necessary rules for your hosting account to make use of Search Engine Friendly URLs.

Conclusion

Whilst not a primary SEO driver, Search Engine Friendly URLs are almost a no-brainer to setup.  WordPress recognises this and provides you with a seriously easy way to configure the URL of each and every post your create for your site.

Assuming your hosting provided has a decent WordPress install setup for you this will work out of the box and should be one of the cornerstones of how you approach your SEO for WordPress.