• Resolved stanley1789

    (@stanley1789)


    Hi,

    I want to change the Post type slug from ?oldslug“ to ?newslug“.

    I know that changing the Post type slug in basic settings will delete all data in that post type.

    My question is what option is best for me?

    1. Change Custom Rewrite Slug
    This works, I tried it on my staging website but I don’t what impact this will have on SEO and google indexing.

    2. Export posts from the current post type(oldslug) create a new post type(newslug) and import posts.

    3. Change slug in child functions.php.

    Best

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    Hi @stanley1789

    We definitely offer the ability to rename the slug and also migrate all the posts from the old slug to the new slug, so you shouldn’t need to worry about items 2 and 3.

    Regarding SEO and the first item, it wouldn’t hurt to redirect the old permalinks to the new one, in the event that WordPress doesn’t automatically do that (which it sometimes does).

    Thread Starter stanley1789

    (@stanley1789)

    Thanks, Michael!

    When you talked about 2 and 3, did you mean about the option in basic settings?
    “Migrate posts to newly renamed post type?“

    Sorry to bother you, but I have one more question.

    When I rename Post Type Slug and check the option Migrate posts to newly renamed post type? and everything went ok.

    Will I have to redirect the posts that are already posted on social networks (they will have the old slug) or will the plugin(wordpress)do it automatically?

    example.com/oldslug/post1 to example.com/newslug/post1

    Best

    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    When you talked about 2 and 3, did you mean about the option in basic settings?

    Yes. When you rename the slug, and then also check that checkbox, upon saving the CPTUI post type settings, we will move all the posts from the old post type slug, to the new one.

    Regarding redirecting, WordPress sometimes seems to manage to find the correct one to show, via ways I don’t completely understand but have seen. To be safe though, I’d recommend setting up redirects on your own.

    I think something like this **may** work, but I haven’t tested it formally.

    RedirectMatch 301 "/old-slug/(.*)$" "/new-slug/$1"
    

    It will hopefully capture any URL coming in at the old slug, and redirect to the new permalink with the post name appended to the end like expected.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Change Post Type Slug’ is closed to new replies.