WordPress.org

Ready to get started?Download WordPress

Forums

Changing URL of a category (5 posts)

  1. ak.singla
    Member
    Posted 5 months ago #

    Hello,

    I want to have Category URL changed.
    But, I fear of losing SEO with this.

    -- Current URL: http://www.example.com/category/travel/photos
    -- Want it to be: http://www.example.com/photos

    ------ This is an important section of the blog, so don't want to mess it.

    Can somebody please suggest me best way to do this?

    I have searched over Google and forums too, have found useful things. But still not sure how should I approach it in the best way?

    They talk about 301 and all, which is something I am not much familiar with.

    Any help will be heartily appreciated, mates.

    Thanks,
    ~Ankit

  2. wiresplus
    Member
    Posted 5 months ago #

    a 301 redirect is what you need. go to WP Docs and search 301 redirect.

  3. ak.singla
    Member
    Posted 5 months ago #

    Hello mate,

    Thanks for your time to talk here.

    Is this the link you're referring to: http://codex.wordpress.org/Function_Reference/wp_redirect

    If yes, how should I use this?
    And, how to change the URL to remove "/category/travel/"

  4. wiresplus
    Member
    Posted 5 months ago #

    And, how to change the URL to remove "/category/travel/"

    'edit permalinks' on the edit page screen. But this will temporarily wreck SEO. A good content site can rapidly reappear in google anyway.

    Wiki on 301

    So, first make a new page that's a top level page, and call it photos. Use it from now on.
    In header.php, add

    <?php if (is_page(' --- ')){
    <?php wp_redirect( 'http://www.example.com/photos', 301 ); exit; ?>
    } ?>
    <?php endif; ?>

    That will make the page number --- redirect to example.com/photos and update google as well at the same time. To find the page number, go to Dashboard>pages and click edit on the existing photos page. look at the URL: in there will be a page ID or ?page=123 bit. pop that number in the code in place of ---.

    Make sense?

  5. ak.singla
    Member
    Posted 5 months ago #

    Yes, does.

    Seems a solution to me.
    Thanks, a lot.

    Please do not close the topic, until it is fully resolved.

Reply

You must log in to post.

About this Topic