I'd like to be able to edit a Page or Post that I'm on in Wordpress rather than go to the admin panel on left and find the page or post.

I somehow think it used to be there, but when I navigate to a page, it's not in the Top Admin Menu options.

  • It should be there by default if you are viewing a single post or page – Bainternet Jul 19 '11 at 5:24
  • yeah, it's strange. I remember it being there, but maybe I turned it off somehow? – dreamgrowers Jul 22 '11 at 16:58
  • I think there must be a plugin that disabled Edit Page from the Top Admin bar. Any ideas on where to track it down? We have dozens of plugins so I'd like not to remove one by one. – user9066 Oct 8 '11 at 6:55
  • This fixed it for me http://core.trac.wordpress.org/attachment/ticket/16798/16798.2.patch – user10172 Nov 10 '11 at 12:58

Typically most themes will include an edit link on the post/page itself that takes you directly to the backend to edit the post. If not, you can always add it yourself with code similar to the following in single.php, page.php, etc.:

<?php edit_post_link('(Edit this post)', '<p>', '</p>'); ?>

(See http://codex.wordpress.org/Function_Reference/edit_post_link for more details.)

Also, check out some of the in-place editing plugins that exist such as Front-end Editor that allow you to modify posts without even entering the backend editor.


Theoretically, you could manually add the link to edit pages in manually using code similar to the following. This may be necessary due to the bug mentioned here in the comments.

function my_admin_bar_link() {
    global $wp_admin_bar;
    global $post;
    if ( !is_super_admin() || !is_admin_bar_showing() )
    if ( is_single() )
    $wp_admin_bar->add_menu( array(
        'id' => 'edit_fixed',
        'parent' => false,
        'title' => __( 'Edit This'),
        'href' => get_edit_post_link($post->id)
    ) );
add_action( 'wp_before_admin_bar_render', 'my_admin_bar_link' );

This can be added to your theme's functions.php. This is untested, but the idea is sound. May still be affected by the same bug.

| improve this answer | |
  • So I've checked and it's up there in the Admin Bar with a fresh install so I much have turned it off somehow. Any thoughts on how I might turn it back on? – dreamgrowers Jul 22 '11 at 20:50
  • 1
    It's basically just turned off of the Default Top Admin Bar and I can't figure out how to turn it back on. – dreamgrowers Jul 23 '11 at 22:53
  • 1
    Hmm, I looked at it on a couple of my blogs and noticed similar behavior. As far as I can tell, it's actually a bug (see #16798 in WP Trac) related to running a query_posts() on the page. Very odd. – Joshua Jul 25 '11 at 1:52
  • So would I just copy that exact code and put anywhere in the functions.php? – dreamgrowers Jul 26 '11 at 9:41
  • I added the function, but didn't see any change... sinc'e it's supposed to be there, I'd really like to get the edit page/post back to the admin bar instead of a plugin that can cause some weirdness at times. – dreamgrowers Jul 26 '11 at 10:45


---> make sure that you set the same URL for the “WordPress address (URL)” and “Site address (URL)” and voila, here's your top admin bar!

| improve this answer | |

If you go to your users/profile page, click on the main user, and then you can select if the admin bar is shown while you are viewing site/in dashboard or both. By selecting "viewing site" you will be able to see the bar again.

| improve this answer | |
  • Thanks for the idea Kate! The Admin Bar is there, but the Menu for editing a page /post disappeared! Not sure how and not sure how to get it back.... – dreamgrowers Aug 1 '11 at 5:00

I am having the same problem.

Yeah according to the link to the bug issue above... the user suggests that the problem is in using query_posts() function on the post page (found within the theme). This somehow triggers wordpress to think that you're editing a category. It sort of makes sense but the suggestion there is to use the get_posts() function instead, which DOES fix the problem. Edit Post link shows However, get_posts() function does not work the same as query_posts and doesn't work for what I need.

I think it might be a bug and for now would take the suggestion of using the edit_posts_link() function for the time being. It's annoying, I agree but so far havent found another solution.

| improve this answer | |
  • I also should say that the add_action function suggested did work for me. So there's that as well. – mrs.d Aug 6 '11 at 1:23
  • Oh, I'd like to try that. So what code are you putting where exactly? – dreamgrowers Aug 9 '11 at 8:55

Adding wp_reset_query() to the bottom of the page fixed it for me!

| improve this answer | |
  • How did resetting the query work for this problem? – Nicole Nov 9 '12 at 15:52

I've had this very same problem, it was bugging for ages, I even came to this page to find a solution and then it hit me.

You just need to reset the query at the bottom of the page using

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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