• [ Moderator note: moved to Fixing WordPress. Please do not use Developing With WordPress for these topics. ]

    Hi,

    I would like to change url structure for archives to not include “page” slug anymore.
    For example archived articles are listed in this organisation:

    mydomain.com/page/01 -> mydomain.com/01
    mydomain.com/page/02 -> mydomain.com/02
    mydomain.com/page/03 -> mydomain.com/03

    How can I do that with htaccess or functions.php? I already have permalinks structure set properly to /%category%/%postname%/ so that they show with corresponding archive name. If anyone know how to do rewriterule, kindly let me know.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hello @virmodrosti

    Add this code to your functions.php file.

    add_action( 'init', 'remove_page' );
    
    function remove_page(){
        global $wp_rewrite; $wp_rewrite->pagination_base = "";
    }

    Please backup your website.

    Hope this will help.

    Thanks.

    Thread Starter virmodrosti

    (@virmodrosti)

    I tried that but the style contains two slashes.

    mydomain.com//01
    mydomain.com//02
    mydomain.com//03

    Thanks for answer anyway.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How to remove all wordpress “page” slugs?’ is closed to new replies.