Update Tags via API

Hello folks. Thought I would ask about the Tags and how important/not really important for information architecture and SEO. Backstory: I have moved to Ghost from Wordpress with approx. 3.5k articles with that I had a lot of categories & tags. Since moving across, these categories and tags are all tags within Ghost which represents ~100s. What I’m thinking: Remove the the vast majority and only have ~10 main areas.

Ok, here goes. I was hoping someone with more capabilities than I do might be able to provide me some direction on updating (a boat load) of TAGS.

Update all posts with the Featured tag to have Feature this post checked (~55 posts)
Delete all Tags except for the following; Opinion, Gear & Tech, Training, Nutrition, News & Racing, Adventures, Interview & #editors-picks (there’s a lot of tags that need removing).

I understand that these changes in bulk maybe possible through the use of the Ghost Admin API. So with that said, I’m hoping some could post some further directions. How familiar am I with APIs and interacting with? Basic (let’s say level 1-2).

In the Ghost admin area, you can generate an “Admin API” API key to use.

If you want to minimize coding, you could use an API helper tool like Postman:

https://www.postman.com/

I believe the basic process will be like:

  • Select all posts
  • For each post, make an update API call which contains some tag merging logic.

It may be simpler to create several calls for each post-- maybe one for each merge you wan to make.

Someone may know of a tool that makes this particular task easier, but I don’t know of of one.

Ultimately, this is a small coding-type task and it might worth hiring a developer for an hour or two to script this for you if you aren’t comfortable working out the details.

Take a look at gctools - GitHub - TryGhost/gctools: Command line utilities for working with Ghost content - it might accomplish what you want, but PLEASE, make a back-up first. It’s entirely possible to mess everything up really quickly.

1 Like

Thanks. I was looking for this tool but couldn’t find it.