# How to create URLs that include post tag

**URL:** <https://forum.ghost.org/t/how-to-create-urls-that-include-post-tag/38761>\
**Category:** Routing\
**Created:** [May 29, 2023, 10:59pm UTC](https://forum.ghost.org/t/how-to-create-urls-that-include-post-tag/38761 "2023-05-29T22:59:07Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![enota](https://avatars.discourse-cdn.com/v4/letter/e/43a26b/32.png) [@enota](https://forum.ghost.org/u/enota)\
**Post date:** [May 29, 2023, 10:59pm UTC](https://forum.ghost.org/t/how-to-create-urls-that-include-post-tag/38761/1 "2023-05-29T22:59:07Z")

</div>

Hi, I’m new-ish to Ghost, and despite Googling my problem and reading up on routing, I can’t figure out what should be a pretty simple and common task, so I must be missing something. Help is appreciated.

Right now, my posts are publishing like:  
[site.com/{slug}](http://site.com/%7Bslug%7D)

I would like to change this so the permalink includes the name of a tag—for the sake of this example, let’s say the tag I want is **report**.

I edited the routes.yaml file to include this, but unfortunately my change does not work. The URLs remain the same as before. What am I doing wrong? Thank you.

```yaml
routes:

collections:
  /:
    permalink: /{slug}/
    template: index
  /report/:
    permalink: /report/{slug}/
    filter: tag:hash-report
  /blog/:
    permalink: /blog/{slug}/

taxonomies:
  tag: /tag/{slug}/
  author: /author/{slug}/

```

---

<div class="post-metadata">

**Author:** ![vikaspotluri123](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/vikaspotluri123/32/24_2.png) [@vikaspotluri123](https://forum.ghost.org/u/vikaspotluri123)\
**Post date:** [May 29, 2023, 11:59pm UTC](https://forum.ghost.org/t/how-to-create-urls-that-include-post-tag/38761/2 "2023-05-29T23:59:19Z")

</div>

There’s a couple things:

1. Since your `/` collection doesn’t have a filter, it’s consuming all the posts, meaning the `/report/` and `/blog/` collections are never used.
2. If you want your posts to have the primary tag in the permalink, you can use the `primary_tag` dynamic variable: `permalink: /{primary_tag}/{slug}/`

For reference, here’s the dynamic routing documentation:

> **[Ghost Themes - Dynamic URLs & Routing](https://ghost.org/docs/themes/routing/)**
>
> Build dedicated URL structures using Ghost's dynamic routing system, for custom homepages, podcasts, categories and more.

And here’s the specific section that discusses the properties + dynamic variables:

> **[Ghost Themes - Dynamic URLs & Routing](https://ghost.org/docs/themes/routing/#index-of-all-available-properties)**
>
> Build dedicated URL structures using Ghost's dynamic routing system, for custom homepages, podcasts, categories and more.

---

<div class="post-metadata">

**Author:** ![enota](https://avatars.discourse-cdn.com/v4/letter/e/43a26b/32.png) [@enota](https://forum.ghost.org/u/enota)\
**Post date:** [May 30, 2023, 12:50am UTC](https://forum.ghost.org/t/how-to-create-urls-that-include-post-tag/38761/3 "2023-05-30T00:50:24Z")

</div>

@vikaspotluri123 Thank you! I used the primary\_tag dynamic variable as you recommended, and it worked.
