WordPress.org

Ready to get started?Download WordPress

Forums

"Add New" page button in admin area (11 posts)

  1. brook1979
    Member
    Posted 2 years ago #

    Hi people,
    Can someone help me with this....when you go into the admin area and click "pages" from the left handside menu, the next page comes up with title "pages" and then a button to add new page...

    is there any way i can remove this button??

    Cheers in advance.

    Brook

  2. Mitchell Bundy
    Member
    Posted 2 years ago #

    Did you just want to remove the button, or remove permission to create pages completely?

    To remove permissions, I'd recommend installing the Members Plugin and removing the permission from the Role(s).

  3. brook1979
    Member
    Posted 2 years ago #

    Hi Mitchell,

    Thanks for your reply......i need to delete the button, its not a member site, just a standard website that the client dosnt need to include anymore pages and would so want it removed.

    Can you help, im still searching but i cant find anywhere with instructions on how to remove it...im sure its something simple and maybe somethin i missed along the way.

    Cheers again for the help....ps, the member plugin has been downloaded,thanks for that, will come in handy.

  4. Mitchell Bundy
    Member
    Posted 2 years ago #

    It's not possible to only remove the button. The only way is by removing the permission to add new pages. If you use the plugin I recommended, it can take care of that for you.

  5. brook1979
    Member
    Posted 2 years ago #

    Thanks for the help mitchell, but im determined to do this without installing a plugin....there must be a way, it's just a button...lol

    Thanks again.

    Brook

  6. brook1979
    Member
    Posted 2 years ago #

    Hi Mitchell,

    Ok im done....ive installed this plugin now, but how do i do it so that it just removes the add new pages button...i still want the client to see and edit his pages that are already there...

    Cheers for the help.

    Brook

  7. Mitchell Bundy
    Member
    Posted 2 years ago #

    Under Users > Roles > Administrator, uncheck "publish_pages", the "add new" button will likely still appear, but they won't be able to publish them.

  8. brook1979
    Member
    Posted 2 years ago #

    Thanks for all the help mitchell....but i DONE IT!!,,,,code below for anyone else trying this.

    // functions.php
    function hide_buttons()
    {
    global $current_screen;

    if($current_screen->id == 'page');
    {
    echo '<style>.add-new-h2{display: none;}</style>';
    }

    // for posts the if statement would be:
    // if($current_screen->id == 'edit-post' && !current_user_can('publish_posts'))
    }
    add_action('admin_head','hide_buttons');

  9. Mitchell Bundy
    Member
    Posted 2 years ago #

    Well, that would hide the button, but if they ever access another method of publishing the page they could easily do so.

  10. brook1979
    Member
    Posted 2 years ago #

    Yeah true true....but i also removed capabilities (thanks to you)from any other user (just incase)and so as you said above it wont let them publish pages...and you were right the button does still appear..

    So its all good, but thanks again Mitchell for all your help

    Brook

  11. Mitchell Bundy
    Member
    Posted 2 years ago #

    Awesome! Glad to hear it all worked out!

Topic Closed

This topic has been closed to new replies.

About this Topic