WordPress allows total control of your link structure and you can set it in the permalink settings. Based on your preference, you can enable or disable the use of trailing slash in WordPress category, tag and post URLs. The structure is important for SEO and trailing slashes might have an impact on it.

If you are not sure what a trailing slash at the end of a URLs is, here are examples:

WordPress and its permalink settings seem to redirect to either one of these and it has some impacts on your site’s search engine ranking. Both links shown above are treated differently by Google. Here’s the official word on it from Google Webmaster Central Blog.

Here’s how you can enable or disable the use of trailing slash in WordPress links that host your content:

Wait, but there’s more…

If you choose the custom structure in such a way that the posts end in .html or /%postname%.html, then you will see that your category links won’t have a trailing slash at the end. If you don’t mind it, then just let it be. If you want to solve it, adding a slash ‘/’ after .html like /%postname%.html/ will not be the optimum solution because now your blog posts ending in .html will also have trailing slashes.

What we actually want to achieve is—avoid the slash in .html links and keep it for the category links.

Here’s the solution:

You have to use a plugin to force trailing slash on category and tag URLs. One such plugin that can do it is the wildly popular and quite useful one called Yoast SEO. The following tutorial is based on it, because chances are that you already have it installed (it is recommended to be installed after starting a WordPress site):

After making sure you have Yoast SEO plugin:

Now, it is guaranteed that your category and tag links will have a trailing slash at the end.

Leave a Reply

Your email address will not be published. Required fields are marked *