# Avoiding Duplicate Post Names/URLs

**URL:** <https://discourse.gohugo.io/t/avoiding-duplicate-post-names-urls/16744>\
**Category:** support\
**Created:** [January 31, 2019, 12:15am UTC](https://discourse.gohugo.io/t/avoiding-duplicate-post-names-urls/16744 "2019-01-31T00:15:20Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![thaethereal](https://avatars.discourse-cdn.com/v4/letter/t/edb3f5/32.png) [@thaethereal](https://discourse.gohugo.io/u/thaethereal)\
**Post date:** [January 31, 2019, 12:15am UTC](https://discourse.gohugo.io/t/avoiding-duplicate-post-names-urls/16744/1 "2019-01-31T00:15:20Z")

</div>

So let’s say I have a blog. On January 1st of 2017 I create posts/happy-new-year.md. Then in 2018 I create posts/happy-new-year.md, see that it already exists, so I create posts/happy-new-year-2.md. Then in 2019 I try the previous two before settling on posts/happy-new-year-3.md.

Software like Wordpress might organize posts like /2019/01/01/happy-new-year and /2018/01/01/happy-new-year, avoiding the issue. Does hugo have any method for organizing posts by time automatically? Or is it on me to somehow do this manually (e.g., hugo new posts/2019/happy-new-year.md)

While I’m not sure how often this sort of thing is going to be a problem, I’d like to get ahead of it now so that URLs don’t need to change in the future.

---

<div class="post-metadata">

**Author:** ![funkydan2](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/funkydan2/32/5636_2.png) [@funkydan2](https://discourse.gohugo.io/u/funkydan2)\
**Post date:** [January 31, 2019, 1:59am UTC](https://discourse.gohugo.io/t/avoiding-duplicate-post-names-urls/16744/2 "2019-01-31T01:59:37Z")

</div>

Yep, you can do this through configuring permalinks in the config.toml file

> **[URL Management](https://gohugo.io/content-management/urls/#permalink-configuration-values)**
>
> Hugo supports permalinks, aliases, link canonicalization, and multiple options for handling relative vs absolute URLs.

I’m pretty sure you can also organise your posts in subdirectories, e.g. `content/posts/2019/01` etc.

---

<div class="post-metadata">

**Author:** ![ju52](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/ju52/32/6749_2.png) [@ju52](https://discourse.gohugo.io/u/ju52)\
**Post date:** [February 1, 2019, 10:42am UTC](https://discourse.gohugo.io/t/avoiding-duplicate-post-names-urls/16744/3 "2019-02-01T10:42:10Z")

</div>

for config-file set

```
[permalinks]
    post = "/:section/:year/:month/:day/:title"

```

under `content/<section>` the structure does not matter
