# Blog articles folder contain date for URL

**URL:** <https://forum.getkirby.com/t/blog-articles-folder-contain-date-for-url/26784>\
**Category:** Questions\
**Created:** [October 20, 2022, 8:43am UTC](https://forum.getkirby.com/t/blog-articles-folder-contain-date-for-url/26784 "2022-10-20T08:43:52Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mactedder](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/mactedder/32/10802_2.png) [@mactedder](https://forum.getkirby.com/u/mactedder)\
**Post date:** [October 20, 2022, 8:43am UTC](https://forum.getkirby.com/t/blog-articles-folder-contain-date-for-url/26784/1 "2022-10-20T08:43:52Z")

</div>

Can you show me how I would setup my blog article page to have the date in the URL automatically. I need this because there will most likely be blog articles with the same title.

**ie: Article name.** This week’s special offers.

**becomes:** `/blog/this-weeks-special-offer-08-10-22`

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [October 20, 2022, 10:57am UTC](https://forum.getkirby.com/t/blog-articles-folder-contain-date-for-url/26784/2 "2022-10-20T10:57:12Z")

</div>

You could add this via a page model: [Page models | Kirby CMS](https://getkirby.com/docs/guide/templates/page-models)

You would have to overwrite the static `create` method in your model. See the original method for details:

> <https://github.com/getkirby/kirby/blob/3.8.1/src/Cms/PageActions.php#L463>

---

<div class="post-metadata">

**Author:** ![mactedder](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/mactedder/32/10802_2.png) [@mactedder](https://forum.getkirby.com/u/mactedder)\
**Post date:** [October 20, 2022, 12:43pm UTC](https://forum.getkirby.com/t/blog-articles-folder-contain-date-for-url/26784/3 "2022-10-20T12:43:42Z")

</div>

Seems a bit too much for my level. I will have to encourage the client to manually change the URL when creating a post

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [October 20, 2022, 4:22pm UTC](https://forum.getkirby.com/t/blog-articles-folder-contain-date-for-url/26784/4 "2022-10-20T16:22:02Z")

</div>

Create a model for your article page (make sure this is named like the blueprint for your article pages, I’m assuming `article` here

```auto

class ArticlePage extends Page
{
    /**
     * Creates and stores a new page
     *
     * @param array $props
     * @return Page
     */
    public static function create(array $props): Page
    {
        $props['slug'] = $props['slug'] . '-' . date('Y-m-d');
        
        return parent::create($props);
    }
}

```
