How to add Edit This link to wordpress theme post page

An Edit This link button is very handy for wordpress blog administrators to click and edit any post on the blog without first going to backend and finding that particular post to edit.

This “Edit this” link is visible only to the admins and not to the general public.

The Edit This link can be easily inserted in wordpress theme even if you’re a beginner and have no experience of editing wordpress or php by following these steps (please read this post till the end before applying):

How to add Edit This link in WordPress theme

1. Login to your wordpress backend

2. From sidebar, goto: Themes > Editor (your theme will be opened to edit, probably style.css file)

3. From the list of your current theme files being shown in the right side list, select “single.php” (or index.php is fine if it don’t have single.php)

4. Look for the part where you want to show the “Edit this” button. If you want it next to heading look for <h1> or <h2> in the theme and so on. When you find the place where you want to add this link, paste this code there:

 <?php edit_post_link(); ?> 

5. Save and check by going to the front end.

Please note, we chose single.php so it will show edit this link on the single blog posts. Not on pages or category archives for your wordpress.

If you want to show the link on all the pages then edit archive.php and index.php to have the link code added to it too.

Also, make sure you have backup of the file with you incase you get something wrong.

If your site is really active and you don’t know what you’re doing, then don’t take the risk and hire some professional to do it for you (contact me via comments here).

Let me know if you have any issues while adding edit this button to your wordpress.

Leave a Reply

Your email address will not be published.