Here’s some handy bookmarklets I use while building WordPress websites.

Edit the current post/page

javascript:(function() { var pageid = Array.from(document.body.classList).filter(function(item) { return item.includes("page-id-") }); var shortlink = document.querySelector("link[rel='shortlink']").getAttribute('href').match(/\?p=(\d+)/)[1]; var id = (pageid.length > 0) ? pageid[0].replace("page-id-", "") : shortlink;  document.location = document.location.origin + "/wp-admin/post.php?&action=edit&post=" + id;})();

This is a modified version of Nat Taylor’s bookmarklet. It’s been modified to skip visiting the login page if you’re already logged in. WP will send you to the login page if you’re not logged in.

This is handy when the WordPress admin bar is hidden.

Go to WP admin / login page

javascript:window.location.href = `${window.location.protocol}//${window.location.hostname}/wp-admin`;

Go to the Site Health admin page

javascript:window.location.href = `${window.location.protocol}//${window.location.hostname}/wp-admin/site-health.php?tab=debug`;

How to use

Add a new bookmark in your browser, paste the JavaScript code into the URL field and give it a meaningful name.

I name mine wp-E (WordPress Edit) and wp-L to save space on my bookmarks bar

Have a nice bookmarklet you use for WordPress development? Share it below in the comments.