Changing URL of a category (5 posts)

  1. ak.singla
    Posted 1 year ago #


    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.


  2. wiresplus
    Posted 1 year ago #

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

  3. ak.singla
    Posted 1 year 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
    Posted 1 year 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
    Posted 1 year ago #

    Yes, does.

    Seems a solution to me.
    Thanks, a lot.

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

Topic Closed

This topic has been closed to new replies.

About this Topic