Support » Fixing WordPress » Remove edit button

  • How can I remove the edit button from all or even a single page?

    I am running a members-only site, so to access a lot of functionality everyone has to be logged in. This is fine for most users as they don’t see the edit button, but for the admins it’s very annoying to have it there on all pages as it gets in the way visually of a lot of plugin functionality such as calendars, chat windows, etc. I really don’t need or want this inline edit button on my site pages. How can I remove it?

Viewing 8 replies - 1 through 8 (of 8 total)
  • Your theme should be putting that link in there using the edit_post_link() function. You can edit your template files to remove it.

    My page says it is using the ‘Default Template’ in twentyeleven. Do you know which php file that is? I don’t see a default.php

    Thanks.

    In TwentyEleven there are 12 files that use edit_post_link(… but the 3 you probably only want to worry yourself with are…

    /content-page.php line 21
    /content-single.php line 52
    /content.php Line 80

    Moderator Jan Dembowski

    (@jdembowski)

    Brute Squad and Volunteer Moderator

    Don’t do that, you’ll lose those edits when there is an update. Create a child theme instead and make those changes there in the child theme directory.

    Yeah… sorry child themes of Default themes is a better choice, I just haven’t used default WordPress themes in years and didn’t think about that =P

    I am using a child theme. I just didn’t know which file to copy 🙂

    consider to use a css quick-fix, by adding this to style.css in the child theme:

    .post-edit-link{display:none;}
    d_random

    (@d_random)

    This worked for me:

    You can put the following code in your functions.php.

    function wpse_remove_edit_post_link( $link ) {
    return ”;
    }
    add_filter(‘edit_post_link’, ‘wpse_remove_edit_post_link’);

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Remove edit button’ is closed to new replies.