Step 13 - Permalinks WordPress Settings

Updated : 22-Jul-2023

Most people recommend using post name for permalinks. If this advice sounds good, set your permalinks to post name, by selecting the Post name option.   This is a great choice and may be best for most people.

An Alternative Permalink

However,  I don’t do that.  I do use postname, but also prefix it with the postid. In other words, I use a custom structure of /%post_id%/%postname%/

Go To Dashboard → Settings → Permalinks.
I like to set my permalinks to post_id/postname as shown below

Permalinks with postid
Permalinks with postid

Why Do I Prefer PostId and Postname In My Permalinks?

I use a custom structure of /%post_id%/%postname%/ because it removes ambiguity and in my opinion, makes the day-to-day running of the site easier.   

I don't know if it interferes with Google’s view of a URL for SEO purposes.  I don’t believe so, as I haven't tested it, but you can come to your own conclusion.

Postname Alone Can Be Ambiguous

Take the example of the Yoast website where I found a selection of blog posts with the following URLs:

  1. https://yoast.com/what-is-a-keyword/
  2. https://yoast.com/what-is-a-keyword-strategy/
  3. https://yoast.com/what-is-a-redirect/
  4. https://yoast.com/what-is-a-permalink/
  5. https://yoast.com/what-is-a-headless-cms/
  6. https://yoast.com/what-is-a-progressive-web-app-pwa/

The above URLs all use the postname to form a slug, which is then used in the URL.  To visit the second page listed - the page about keyword strategy - you would have to type most of the following URL, https://yoast.com/what-is-a-keyword-strategy/, in order to ensure you ended up at the right page.  

This is because the URL is very similar to other URLs on the site as shown in the list above.  Unless you type practically the full URL in each case, WordPress would have no idea which page you wanted to visit due to each of the URLs listed, being largely similar.

Adding PostId Makes Life Easier

However if the postid is included you can visit a page using only its id. So if the URL were

https://yoast.com/123/what-is-a-keyword-strategy/ - all you would have to type is https://yoast.com/123/ (assuming you set your site up to allow this.)

This helps when typing URLs, say, into mobile phones, or when communicating a URL over voice. It’s much easier to type or communicate

https://yoursite.com/123/ than

https://yoursite.com/what-is-a-progressive-web-app-pwa/

An added benefit is that you can change the slug used in your post URL at will, for SEO purposes (should you ever need to) without having to set up a redirect after each change.

But Is PostName Better For SEO Than PostId/PostName?

To be clear -using the post id and the post name as I prefer to do, I am guessing, makes no practical difference to using only the post name. But please know I have not tested one method versus the other so I do not know.

However, for the reasons outlined above, I prefer the flexibility of the post id followed by the post name.

Certainly when Google lists a page whose permalink contains a post id in the search results, Google does not include the post id in the listing. This implies that Google is fully aware of post ids and so I am assuming, discounts them for SEO purposes. But I could be wrong.

More From This Series

Français (French)
Translation

× Close