Tech Dreams

Add “Edit This Post” Link To Blog Posts To Quickly Edit Them [WordPress]

wordpress_logo While going through the articles on my blog, I often find the necessity to improve the quality of content or optimize the post for search engines. To edit the post I need to login to WordPress, search the post and click on the edit link. This is a time consuming process. Will it not be handy if I’ve a link on every post that takes me to directly post edit page? Yes, it is.

A simple WordPress theme modification added this very handy feature to my blog. Now I’ can go to edit page of every post by just click on the link “Edit this post” as shown in the below image

 Edit_this_post_link

To display a link to edit the current post, if a user is logged in and allowed to edit the post add this following code to WordPress template


<?php edit_post_link(‘Edit this post’, ”, ”); ?>


If you are a WordPress newbie, you might be wondering to which files of theme we have to add this piece of code. For displaying the link in individual post pages add this code to single.php file. If you want to have this link on home page then you should add it to index.php file.

Need more instructions? Drop a comment or fill the contact form, I’ll be glad to assist you.