{
"$type": "site.standard.document",
"bskyPostRef": {
"cid": "bafyreic7ytufcxwjtqul3gcnh5jisw2thdygpqh7kwptnwg3dcheibf6bu",
"uri": "at://did:plc:fuaxi56ej27ymlesklypt3ar/app.bsky.feed.post/3mnbahstaikq2"
},
"description": "Save several milliseconds with two lines of JavaScript",
"path": "/copy-ghost-post-id-to-clipboard-bookmarklet/",
"publishedAt": "2026-06-01T23:32:26.000Z",
"site": "https://www.autodidacts.io",
"tags": [
"save it as markdown",
"like I did",
"@curiositry",
"Twitter",
"GitHub",
"linking to text fragments",
"jumping between staging and production versions of a site",
"excellent bookmarklet encoder"
],
"textContent": "I often need to get the internal UUID for a Ghost CMS post: for example, in order to save it as markdown.\n\nPreviously, I would go to the post, append `/edit` to the URL, hit enter, and then copy the last section of the URL, which is the UUID for the post in the editor. Tedious!\n\nAs I suspected, the post ID is right there in the HTML of the post: it’s used to load comments for the right post. So, like I did for appending `/edit` to the URL:\n\nDrag the link below to your bookmarks bar and click it when you’re viewing a post on your Ghost blog:\nEdit Post!\nIt will append `/edit` to the url and reload, so you can edit your post\n— Built with ❤ by @curiositry (Twitter, GitHub)\n\n.... and linking to text fragments, and jumping between staging and production versions of a site, I wrote a two-line bookmarklet to extract the current post ID, and put it on the clipboard:\n\n\n let postId = document.querySelector(\"[data-post-id]\").getAttribute(\"data-post-id\");\n navigator.clipboard.writeText(postId).then(() => {\n console.log('Post ID copied to clipboard:', postId);\n });\n\nDrag the link below to your bookmarks bar, and click on it when you want to get a post ID from your blog:\n\nCopy Ghost Post ID to Clipboard\n\n(Thanks to Chris Zarate for making the excellent bookmarklet encoder applet that I use every time I need to make a bookmarklet. It works great, and can even be saved and used offline.)",
"title": "Bookmarklet: Copy Ghost Post ID to Clipboard",
"updatedAt": "2026-06-03T06:18:55.571Z"
}