External Publication
Visit Post

Bookmarklet: Copy Ghost Post ID to Clipboard

The Autodidacts June 1, 2026
Source

I often need to get the internal UUID for a Ghost CMS post: for example, in order to save it as markdown.

Previously, 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!

As 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:

Drag the link below to your bookmarks bar and click it when you’re viewing a post on your Ghost blog: Edit Post! It will append /edit to the url and reload, so you can edit your post — Built with ❤ by @curiositry (Twitter, GitHub)

.... 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:

let postId = document.querySelector("[data-post-id]").getAttribute("data-post-id");
navigator.clipboard.writeText(postId).then(() => {
    console.log('Post ID copied to clipboard:', postId);
});

Drag the link below to your bookmarks bar, and click on it when you want to get a post ID from your blog:

Copy Ghost Post ID to Clipboard

(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.)

Discussion in the ATmosphere

Loading comments...