Slug resulting from tags composed by several words

I have located a small improvement concerning the tags.

Specifically when we create a tag in the system, which consists of two words: blue houses, for example through the post page, or through the content page or through the administrator, the system reproduces it in its slug version, as: blue_houses and not as: blue-houses.

The goal is to be able to use tags of two or more words and that the resulting slug version is:

https://www.domain.com/blue-houses

Thinking about the correct optimization of the resulting URL, for the SEO of the site.

I think the problem might be due to whitespace.

I am using the latest updated version of Ghost.

Thank you very much for your support and for the extraordinary work you do every day to make this software possible.

Sincerely yours,

Jesus Perez

How are you creating tags? Slugs in Ghost are explicitly intended to be part of the URL, and the generated ones always use hyphens, not underscores.

The code used to generate slugs is here: SDK/slugify.js at main · TryGhost/SDK · GitHub

However, Ghost does permit underscores in slugs, so that people moving from different platforms can keep their URLs.

I cannot think of any way that Ghost could possibly generate a slug with an underscore unless they are explicitly being written into the field via the UI, API or importer.

2 Likes

Good Hannah!

Thank you very much for your clarification, in principle I detected the error, by means of:

Post > Post Setting

and the creation of a new tag.

But thanks to your message, I have been more careful in the process and analyzing your comments, it seems that it no longer gives an error. So if it was a fix or an improvement. I only have words of thanks once again for the amazing work you do, I believe that Ghost is the future and I will continue to blindly bet on it.

A million thanks and best wishes to the whole team.

A hug.