Add Quick Edit Button in WordPress Posts and Comments

Quick Edit WordPress Feature for Posts

Does your WordPress theme include a quick edit button or link for editing your WordPress posts and comments?

Quick edit links help you easily edit your WordPress posts from the front-end of your WordPress blog. It's much easier rather than going back to your Posts in the admin section and searching for the particular post to edit it.

The quick edit links can be really time-saving and efficient for WordPress admins.

If your website's theme doesn't have the quick edit button built in, you might consider adding it.

In this post, let’s go through the steps of adding the button to your theme.

Note: This tip is only for those who are comfortable editing their WordPress code manually.

Quick Edit Buttons for WordPress Posts

1. From the WordPress dashboard of your blog, navigate to theme editor.

Appearance >> Editor

2. Now open your theme’s single.php file and add the below code anywhere in the loop.

The code will display quick edit link and can be used for pages, posts, attachments, and revisions.

The edit_post_link function used in the code above takes a maximum of 4 parameters.

If you're a developer, you can use these additional parameters within the code including;

$link : (string) (optional) The link text. Default: __(‘Edit This')

$before : (string) (optional) Text to put before the link text. Default: None

$after : (string) (optional) Text to put after the link text. Default: None

$id : (integer) (optional) Post ID (added in WordPress 2.8). Default: None

$class : (string) (optional) CSS class name for the link (added in WordPress 4.4).
Default: post-edit-link

Quick Edit Buttons for WordPress Comments

First, check to see if you already have this option in your theme as most of the themes come with prebuilt function. If not then follow these steps.

  1. Open your theme's comments.php file and add the below code.

Quick Edit Link for Genesis Themes

If you use Genesis themes, there's an easier way to include the quick edit link.

  • Download and install the Genesis Simple Edits plugin.
  • From your dashboard, go to Genesis > Simple Edits
  • Add the post_edit [post_edit] shortcode to Entry Meta (above content) or Entry Meta (below content) depending on where you want the quick edit link to appear.
Genesis Simple Edits button

Using Edit Post in Navigation Menus

Alternatively, you can use the Edit Post link included in the navigation menu of your WordPress site.

When you are logged in and provided that your theme supports it (most themes have support for the Navigation Menus), you should see a Navigation menu with an Edit Post link that you can use to directly edit the post /page.

See the screenshot below showing “Edit Post” link in the Navigation Menu.

Edit Post Link WordPress Navigation Menu

Do you use quick edit buttons in your WordPress theme?

Share on reddit
Share This Article
Share on facebook
Facebook
Share on linkedin
LinkedIn
Share on twitter
Twitter
Share on email
Email
Pradeep Singh
Pradeep Singh
Pradeep Singh is the founder and your host here at WPism. He is an entrepreneur and blogger living his startup life based in London and Cambridge. Follow him on Twitter or like his page on Facebook.

Leave a Reply

Your email address will not be published. Required fields are marked *

Want to keep updated with WordPress?

Join our monthly newsletter to receive best curated WordPress resources.

Want to keep updated with WordPress? Join our monthly newsletter.