0

I recently changed a page title and URL and now the subpages are getting a 404 error.

Changed:

/events/activities

to

/calendar/activities

The /calendar page still displays correctly, the same as it did when it was previously named /events. However, all of the subpages (/activities, /contests, etc.) now return 404 errors.

I tried re saving permalinks, but same result. I'm using Post name as my permalink structure. I don't think there are any conflicting slugs using calendar.

I'm a bit confused about permalinks and how to properly change them (obviously).

1 Answer 1

0

Based on what you wrote above I do not see the problem of changing the page name would result in 404 errors on sub-level pages.

What you should look for

1- Check if you do not have active plugins like (The Event Calendar) or equivalents. Those plugins are already using, most of the time, those slug or rewrite rules.

2- You did not mentionned that you were using Custom Post Type, but if it would be the case, you can edit the rewrite rule to place your new slug (Codex : register_post_type)

function register_custom_post_type_example() {
    $rewrite = array(
        'slug'                  => 'calendar',
        'with_front'            => true,
        'pages'                 => true,
        'feeds'                 => true,
    );
    $args = array(
        'label'                 => 'Your label'
        'description'           => 'Your description',
        'supports'              => array('page-attributes'),
        'taxonomies'            => array(),
        'hierarchical'          => false,
        'public'                => true,
        'show_ui'               => true,
        'show_in_menu'          => true,
        'menu_position'         => 20,
        'menu_icon'             => 'dashicons-networking',
        'show_in_admin_bar'     => true,
        'show_in_nav_menus'     => true,
        'can_export'            => true,
        'has_archive'           => true,
        'rewrite'               => $rewrite,
    );
    register_post_type( 'equipe', $args );
}
add_action( 'init', 'register_custom_post_type_example' );

In the code above, you can see that you can change the rewrite rule. But as I said, do not try to work with alot of plugin because it will results in pages conflicts.

Hope it can guide you to find the problem.

2
  • Patrice, thank you for the help. I'm using the calendar plugin Simple Calendar. Based on your first suggestion I disabled the Simple Calendar plugin to see if the page was still broken. It was not. Enabling the plugin broke the page again. Since I am using the Custom Post Type I will try your solution. Stay tuned... Commented Nov 28, 2017 at 21:38
  • So the plugin itself is setting some rewrite rules. I suggest you change the slug. The documentation of your plugin seems to not give the power to change the slugs. Feel free to upvote my anwser if it helped you. Commented Nov 28, 2017 at 22:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.