In Admin, is there any way to use a slug instead of a post ID# within the URL that takes you to a post's edit screen.

So instead of:


You would use something like:


Or, since the database stores the slug in the column post-name:


Of course, neither of these actually works. Is there some existing method for doing this using Wordpress' built-in URL parameters?

If not, what sort of function could be used in my theme's functions.php file that would make this work?

  • 1
    slugs aren't necessarily unique, so this would be prone to failure. why do you want to do this? what problem are you trying to solve?
    – Milo
    Commented Dec 17, 2014 at 19:01
  • That's interesting, because I thought slugs were unique. I've often encountered a situation where I unknowingly created a post with the same title, and the slug generated appended with a number like '-2'. Anyway, I have a quick link to edit my home page created using Admin Menu Editor, but I had to duplicate and revise it, making the duplicate into the home page. I deleted the old one and changed the slug for the new one to 'home' (like the old one had). Of course, now my quick link no longer works. I'd like a link that always goes to edit page for my 'home' page, no matter what the ID is.
    – cvc
    Commented Dec 17, 2014 at 19:06
  • 1
    slugs only have to be unique within a post type on the same level of hierarchy. if you want something like you describe, direct your request to admin-post.php, do your lookup, and redirect to the normal admin url for that post.
    – Milo
    Commented Dec 17, 2014 at 19:13
  • 1
    How would you handle post revisions? Also why would you want this? Users shouldn't notice the URLs in the admin panel, are you trying to manually construct edit urls?
    – Tom J Nowell
    Commented Dec 17, 2014 at 19:35
  • This may be a fringe case, Tom...
    – cvc
    Commented Dec 18, 2014 at 18:13

1 Answer 1


If the home page is set as "Home" in settings, use:

get_edit_post_link( get_option( 'page_on_front' ) );
  • witch place I need to place it it's not working when I put it in function
    – EnigmaOs
    Commented Sep 30, 2022 at 22:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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