• Resolved danhgilmore

    (@danhgilmore)


    I need to remove the ability for folks to change the format of permalinks. I have a plugin that does that, but users can still see the page to change permalinks. How do I remove that item from the side menu?

    The following code does not work for me:

    add_action('admin_init', 'remove_permalink_menu', 999);
    function remove_permalink_menu()
    {
        remove_menu_page('options-permalink.php');
    }
Viewing 3 replies - 1 through 3 (of 3 total)
  • Because it’s a submenu page you need to use:

    add_action('admin_init', 'remove_permalink_menu', 999);
    function remove_permalink_menu()
    {
        remove_submenu_page( ‘options-general.php’, ‘options-permalink.php’ );
    }
    Thread Starter danhgilmore

    (@danhgilmore)

    Thanks Ryan, that absolutely fixed it. Off to get coffee.

    Thread Starter danhgilmore

    (@danhgilmore)

    “Users with manage_options cap can still go to the page directly and update the permalinks structure.”

    Yep, but I have another function that prevents the change getting saved to the database. I’ll just need to add some text to the top of that page informing users they can’t change the settings

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Remove Permalink option menu item’ is closed to new replies.