{"id":2734,"date":"2021-07-15T04:08:44","date_gmt":"2021-07-15T03:08:44","guid":{"rendered":"https:\/\/www.nathankowald.com\/blog\/?p=2734"},"modified":"2022-11-18T14:41:53","modified_gmt":"2022-11-18T04:11:53","slug":"wordpress-bookmarklets","status":"publish","type":"post","link":"https:\/\/www.nathankowald.com\/blog\/2021\/07\/wordpress-bookmarklets\/","title":{"rendered":"WordPress Bookmarklets"},"content":{"rendered":"\r\n<p>Here&#8217;s some handy <a href=\"https:\/\/en.wikipedia.org\/wiki\/Bookmarklet\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">bookmarklets<\/a> I use while building WordPress websites.<\/p>\r\n\r\n\r\n\r\n<h2 class=\"wp-block-heading\">Edit the current page or post<\/h2>\r\n\r\n\r\n\r\n<pre class=\"wp-block-code\"><code>javascript:!function(){const e=Array.from(document.body.classList).filter((function(e){return e.includes(\"page-id-\")||e.includes(\"postid-\")})),o=e.length?e[0].replace(\/page-id-|postid-\/,\"\"):0;if(!o)return void alert(\"No WordPress post found\");let t=document.querySelector('link[rel=\"https:\/\/api.w.org\/\"]');t=t&amp;&amp;t.href?t.href.replace(\"\/wp-json\/\",\"\"):document.location.origin,window.location.href=`${t}\/wp-admin\/post.php?action=edit&amp;post=${o}`}();<\/code><\/pre>\r\n\r\n<p><a href=\"https:\/\/gist.github.com\/n8kowald\/970e9614d374a9bca4384ffe765c8515\" target=\"_blank\" rel=\"noopener nofollow\">View unminified version<\/a>.<\/p>\r\n\r\n<p>This next one is a modified <a href=\"https:\/\/nattaylor.com\/blog\/2019\/bookmarklet-edit-current-wordpress-page\/\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">Nat Taylor&#8217;s bookmarklet<\/a>. It&#8217;s modified to skip visiting the login page if you&#8217;re already logged in. WP will send you to the login page if you&#8217;re not logged in.<\/p>\r\n\r\n\r\n\r\n<p>This is handy when the WordPress admin bar is hidden.<\/p>\r\n\r\n\r\n\r\n<h2 class=\"wp-block-heading\">Go to WP admin \/ login page<\/h2>\r\n\r\n\r\n\r\n<pre class=\"wp-block-code\"><code>javascript:window.location.href = `${window.location.protocol}\/\/${window.location.hostname}\/wp-admin`;<\/code><\/pre>\r\n\r\n\r\n\r\n<h2 class=\"wp-block-heading\">Go to the Site Health admin page<\/h2>\r\n\r\n\r\n\r\n<pre class=\"wp-block-code\"><code>javascript:window.location.href = `${window.location.protocol}\/\/${window.location.hostname}\/wp-admin\/site-health.php?tab=debug`;<\/code><\/pre>\r\n\r\n\r\n\r\n<h2 class=\"wp-block-heading\">How to use<\/h2>\r\n\r\n\r\n\r\n<p>Add a new bookmark in your browser, paste the JavaScript code into the URL field and give it a meaningful name.<\/p>\r\n\r\n\r\n\r\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/www.nathankowald.com\/blog\/wp-content\/uploads\/2021\/07\/edit-bookmarklet.png\"><img loading=\"lazy\" decoding=\"async\" width=\"997\" height=\"1024\" class=\"wp-image-2737\" src=\"https:\/\/www.nathankowald.com\/blog\/wp-content\/uploads\/2021\/07\/edit-bookmarklet-997x1024.png\" alt=\"\" srcset=\"https:\/\/www.nathankowald.com\/blog\/wp-content\/uploads\/2021\/07\/edit-bookmarklet-997x1024.png 997w, https:\/\/www.nathankowald.com\/blog\/wp-content\/uploads\/2021\/07\/edit-bookmarklet-292x300.png 292w, https:\/\/www.nathankowald.com\/blog\/wp-content\/uploads\/2021\/07\/edit-bookmarklet-768x789.png 768w, https:\/\/www.nathankowald.com\/blog\/wp-content\/uploads\/2021\/07\/edit-bookmarklet-900x924.png 900w, https:\/\/www.nathankowald.com\/blog\/wp-content\/uploads\/2021\/07\/edit-bookmarklet.png 1030w\" sizes=\"auto, (max-width: 997px) 100vw, 997px\" \/><\/a>\r\n<figcaption>I name mine wp-E (WordPress Edit) and wp-L to save space on my bookmarks bar<\/figcaption>\r\n<\/figure>\r\n\r\n\r\n\r\n<p>Have a nice bookmarklet you use for WordPress development? Share it below in the comments.<\/p>\r\n","protected":false},"excerpt":{"rendered":"<p>Here&#8217;s some handy bookmarklets I use while building WordPress websites. Edit the current page or post View unminified version. This next one is a modified Nat Taylor&#8217;s bookmarklet. It&#8217;s modified to skip visiting the login page if you&#8217;re already logged in. WP will send you to the login page if you&#8217;re not logged in. This [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":2738,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[21,14,7,33],"tags":[],"class_list":["post-2734","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-bookmarklets","category-useful-information","category-web-development","category-wordpress"],"acf":[],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.nathankowald.com\/blog\/wp-json\/wp\/v2\/posts\/2734","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.nathankowald.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.nathankowald.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.nathankowald.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.nathankowald.com\/blog\/wp-json\/wp\/v2\/comments?post=2734"}],"version-history":[{"count":12,"href":"https:\/\/www.nathankowald.com\/blog\/wp-json\/wp\/v2\/posts\/2734\/revisions"}],"predecessor-version":[{"id":2867,"href":"https:\/\/www.nathankowald.com\/blog\/wp-json\/wp\/v2\/posts\/2734\/revisions\/2867"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.nathankowald.com\/blog\/wp-json\/wp\/v2\/media\/2738"}],"wp:attachment":[{"href":"https:\/\/www.nathankowald.com\/blog\/wp-json\/wp\/v2\/media?parent=2734"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.nathankowald.com\/blog\/wp-json\/wp\/v2\/categories?post=2734"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.nathankowald.com\/blog\/wp-json\/wp\/v2\/tags?post=2734"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}