Support » Fixing WordPress » What will happen if I change category slug

  • Suppose I am using domain.com/category-old-slug/post-name/ and then I change slug of category from admin panel.

    New posts will be domain.com/category-new-slug/post-name/ but what will happen to old posts?

    Regards,
    Abhishek

Viewing 8 replies - 1 through 8 (of 8 total)
  • If you do this globally via Settings/Permalinks, WordPress should handle any redirects.

    Thread Starter abhis2.0

    (@abhis20)

    I am not changing permalink structure. It would remain same %categories%/%post%/ . I want to change categories slug.

    I was talking of changing slugs from Admin Menu > Posts > Categories > Quick edit > Slug

    By the way, thanks for quick response.

    If you edit individual category slugs, your links will be fine internally but you may break some incoming links.

    Thread Starter abhis2.0

    (@abhis20)

    Now since I have some good incoming links, I cant change it.

    Is there any other option, that would automatically redirect?

    As a general rule, WP core should do it.

    As I understand it, the core can only handle redirects if the underlying slugs (ugly permalinks) remain unchanged. As soon as you manually edit a slug, you change the relevant db table value. WP can’t redirect if it doesn’t have a copy of the old slug… if you see what I mean.

    Thread Starter abhis2.0

    (@abhis20)

    Thanks esmi.

    So, After changing slugs I need to write some rules in .htaccess. Right?

    or something for those 301 redirects.

    Right?

    Pretty much, yes. You could try using the Redirection plugin but I found it easier to edit .htaccess file directly.

    Thread Starter abhis2.0

    (@abhis20)

    esmi, I am already using redirect plugin for blogspot to wp url redirects.

    Can you please help me in writing .htaccess rule.

    I would really appreciate if you can device some regular expression.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘What will happen if I change category slug’ is closed to new replies.