• Resolved Martin Blumenfeld

    (@monkeypress)


    Being able to select posts primary category is a great feature, but we noticed that when you change the primary category it won’t change the post’s permalink. Is there some setting we need to enable in order to make the permalink change when the primary category changes?

Viewing 10 replies - 1 through 10 (of 10 total)
  • Uros Tasic

    (@wpaurorautasic)

    You need to manually change the permalink for every post you change the category. And you need to manually do redirection because you will get 404 if you do not do a redirect.

    Thread Starter Martin Blumenfeld

    (@monkeypress)

    Considering you can access a post from any of the selected categories, it shouldn’t produce 404 errors. It would simply change the base permalink that you get from get_permalink calls.

    Uros Tasic

    (@wpaurorautasic)

    It is standard procedure to redirect links (after changing them), Why? Because if google index it, or you have a link somewhere else it would work.

    Hi Martin,

    Yoast will output the primary category as the permalink. You can see it get changed in these images here: https://pasteboard.co/Hz9UloR.png and https://pasteboard.co/Hz9UpVN.png. Though, if you go to Settings-Permalink you will need to make sure you have category as part of the permalink.

    Is that not happening?

    Also, please know that (as @wpaurorautasic pointed out) you will need to create a redirect from the old permalink to the new one. Yoast SEO Premium is expected to automatically create one for you but there is an issue with it that prevents it from doing so.

    So whatever redirect tool you use, you will need to manually make one. Yoast SEO Premium offers a Redirection Management section so you can manually enter these redirects in or you may use a different tool. You can learn more about Yoast SEO Premium including how to buy it here: https://yoast.com/wordpress/plugins/seo/

    We also have a guide that discuss how you can manually edit your server or theme files to add redirects: https://yoast.com/create-301-redirect-wordpress/.

    • This reply was modified 6 years, 3 months ago by Pcosta88.
    Thread Starter Martin Blumenfeld

    (@monkeypress)

    @wpaurorautasic: Yes, if I had an old post and changed the primary category, it would be best to create a redirect for SEO purposes. I was just commenting that even if I change the primary category and the URL changes, I could still access the post from the old category as long as I didn’t remove it from the post. And thus it wouldn’t produce a 404 error. I assume Yoast is outputting a canonical meta tag back to whatever the new primary category would have been.

    @pcosta88: When we change the primary category and update the post the permalink doesn’t change to match the new category. And yes we have the category in our permalink structure. Seeing that it’s working for you and it doesn’t require a setting change, we must have a theme and/or plugin issue I need to dig into.

    Plugin Support Md Mazedul Islam Khan

    (@mazedulislamkhan)

    In this case, we recommend you please perform a conflict check by following the steps are given in this guide to see if you can find the exact source of the issue.

    Plugin Support Jerlyn

    (@jerparx)

    Closed. No further concerns.

    Thread Starter Martin Blumenfeld

    (@monkeypress)

    @pcosta88 is Yoast supposed to automatically change the permalink for custom post types as well if you change the primary category? I know it won’t set up the redirects.

    Hi Martin,

    Yes, Yoast is expected to change the permalink for custom post types to reflect the primary category. However, it is not working as expected. We have an open issue here: https://github.com/Yoast/wordpress-seo/issues/11006 which reflects this.

    We suggest commenting on it so you may be kept aware of updates.

    Thread Starter Martin Blumenfeld

    (@monkeypress)

    Thanks!!

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Change post permalink when selecting new primary category’ is closed to new replies.