# New posts are automatically repeated multiple times

**URL:** <https://forum.ghost.org/t/new-posts-are-automatically-repeated-multiple-times/49655>\
**Category:** Developer help\
**Created:** [August 20, 2024, 12:06pm UTC](https://forum.ghost.org/t/new-posts-are-automatically-repeated-multiple-times/49655 "2024-08-20T12:06:22Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gloria](https://avatars.discourse-cdn.com/v4/letter/g/b38774/32.png) [@Gloria](https://forum.ghost.org/u/Gloria)\
**Post date:** [August 20, 2024, 12:06pm UTC](https://forum.ghost.org/t/new-posts-are-automatically-repeated-multiple-times/49655/1 "2024-08-20T12:06:22Z")

</div>

Hi, every time I add new posts to a collection, all the existing posts duplicate multiple times. It’s really weird because the homepage looks perfectly normal. Any help would be greatly appreciated!

 ![Screenshot 2024-08-20 at 14.01.28](https://us1.discourse-cdn.com/flex015/uploads/ghost2/original/3X/8/1/8185a59d76c00c5e8c74b5fa3cff3aa8e16507cd.jpeg)

---

<div class="post-metadata">

**Author:** ![Cathy\_Sarisky](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/cathy_sarisky/32/25750_2.png) [@Cathy\_Sarisky](https://forum.ghost.org/u/Cathy_Sarisky)\
**Post date:** [August 20, 2024, 12:30pm UTC](https://forum.ghost.org/t/new-posts-are-automatically-repeated-multiple-times/49655/2 "2024-08-20T12:30:08Z")

</div>

This is probably an error in the logic of the theme. If you switch to one of the official themes, does the problem disappear? Which theme is this?

---

<div class="post-metadata">

**Author:** ![Gloria](https://avatars.discourse-cdn.com/v4/letter/g/b38774/32.png) [@Gloria](https://forum.ghost.org/u/Gloria)\
**Post date:** [August 20, 2024, 1:13pm UTC](https://forum.ghost.org/t/new-posts-are-automatically-repeated-multiple-times/49655/3 "2024-08-20T13:13:45Z")

</div>

Thanks for your reply. I was using the “edge-v1.0.0” theme. Then, I switch to one of the official themes, all my customizations were gone and posts disappeared from the collections. When I switched back to “edge-v1.0.0” and re-uploaded my old routes.yaml file, posts still disappeared from the collections.

Any tips on how to fix it would be greatly appreciated!

---

<div class="post-metadata">

**Author:** ![Raki](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/raki/32/40808_2.png) [@Raki](https://forum.ghost.org/u/Raki)\
**Post date:** [August 20, 2024, 5:50pm UTC](https://forum.ghost.org/t/new-posts-are-automatically-repeated-multiple-times/49655/4 "2024-08-20T17:50:08Z")

</div>

Could you please share the content of your `routes.yaml`, there might be some mistakes in it.

---

<div class="post-metadata">

**Author:** ![Gloria](https://avatars.discourse-cdn.com/v4/letter/g/b38774/32.png) [@Gloria](https://forum.ghost.org/u/Gloria)\
**Post date:** [August 20, 2024, 6:54pm UTC](https://forum.ghost.org/t/new-posts-are-automatically-repeated-multiple-times/49655/5 "2024-08-20T18:54:20Z")

</div>

Thanks for you help.

```auto
routes:

collections:
  /:
    permalink: /{slug}/
    template: index

  /ux-ui/:
    permalink: /ux-ui/{slug}/
    template: ux-ui
  /printing/:
    permalink: /printing/{slug}/
    template: printing
  /photography/:
    permalink: /photography/{slug}/
    template: photography
  /packaging/:
    permalink: /packaging/{slug}/
    template: packaging
  /logo/:
    permalink: /logo/{slug}/
    template: logo
  /other/:
    permalink: /other/{slug}/
    template: other

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

```

---

<div class="post-metadata">

**Author:** ![Raki](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/raki/32/40808_2.png) [@Raki](https://forum.ghost.org/u/Raki)\
**Post date:** [August 20, 2024, 9:02pm UTC](https://forum.ghost.org/t/new-posts-are-automatically-repeated-multiple-times/49655/6 "2024-08-20T21:02:58Z")

</div>

You’ve created many templates for collections, let’s debug this step by step, what do you write in the “photography” template?

> When I switched back to “edge-v1.0.0” and re-uploaded my old routes.yaml file, posts still disappeared from the collections.

Is this issue persisting? If so, check how many version of “edge” theme are installed in **Ghost settings =\> design & branding =\> change theme =\> installed**

---

<div class="post-metadata">

**Author:** ![Gloria](https://avatars.discourse-cdn.com/v4/letter/g/b38774/32.png) [@Gloria](https://forum.ghost.org/u/Gloria)\
**Post date:** [August 21, 2024, 2:11am UTC](https://forum.ghost.org/t/new-posts-are-automatically-repeated-multiple-times/49655/7 "2024-08-21T02:11:47Z")

</div>

Thanks for your reply.  
This issue is persisting. Only one version of “edge” theme are installed.  
what I write in the “photography” template:

{{!\< default}}

 {{#get "posts" limit="all" include="tags"}} {{#foreach posts}} {{#match primary\_tag.name 'photography' }} {{\> "loop"}} {{/match}} {{else}} 
There is not post
 {{/foreach}} {{/get}} 
 {{pagination}}

---

<div class="post-metadata">

**Author:** ![Cathy\_Sarisky](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/cathy_sarisky/32/25750_2.png) [@Cathy\_Sarisky](https://forum.ghost.org/u/Cathy_Sarisky)\
**Post date:** [August 21, 2024, 3:44am UTC](https://forum.ghost.org/t/new-posts-are-automatically-repeated-multiple-times/49655/8 "2024-08-21T03:44:36Z")

</div>

Your routes.yaml is a bit odd. You’d normally want a filter on each collection, indicating which posts go into that collection. And because posts go into the first collection they match, you’ll want to think carefully about order, if it’s possible they might match multiple collections. (This is a good reason to use the primary\_tag, and to put the `/:` collection last…)

So like:

```auto
  /photography/:
    permalink: /photography/{slug}/
    template: photography
    filter: primary_tag: photography

```

Then, in photography.hbs, the posts will already be available and will already be filtered, so you can reduce it to:

```auto
{{!< default}}

{{#foreach posts}}
 {{> "loop"}} 
{{else}}
There is not post
{{/foreach}}
{{pagination}}

```

---

<div class="post-metadata">

**Author:** ![Raki](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/raki/32/40808_2.png) [@Raki](https://forum.ghost.org/u/Raki)\
**Post date:** [August 21, 2024, 3:49am UTC](https://forum.ghost.org/t/new-posts-are-automatically-repeated-multiple-times/49655/9 "2024-08-21T03:49:22Z")

</div>

It looks like the custom template is very similar to the “index” template except it filters by a specified primary tag.

The reason why your collections don’t work is that: a post can only be in one collection, your first collection is “/”, which includes all posts, meaning all posts are in the first collection, and not visible in other collections.

Based on your website screenshot, I think “channel” is a better choice for you. Check this link for more details:

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

You don’t need to create custom templates for each custom URL, the “index” template should handle your needs.

---

<div class="post-metadata">

**Author:** ![Gloria](https://avatars.discourse-cdn.com/v4/letter/g/b38774/32.png) [@Gloria](https://forum.ghost.org/u/Gloria)\
**Post date:** [August 22, 2024, 12:09pm UTC](https://forum.ghost.org/t/new-posts-are-automatically-repeated-multiple-times/49655/10 "2024-08-22T12:09:03Z")

</div>

I just wanted to say a big thank you for your help with my problem.  
Your advice was incredibly helpful, and I really appreciate you taking the time to assist me. You’re a lifesaver!

---

<div class="post-metadata">

**Author:** ![Gloria](https://avatars.discourse-cdn.com/v4/letter/g/b38774/32.png) [@Gloria](https://forum.ghost.org/u/Gloria)\
**Post date:** [August 22, 2024, 12:36pm UTC](https://forum.ghost.org/t/new-posts-are-automatically-repeated-multiple-times/49655/11 "2024-08-22T12:36:09Z")

</div>

I just wanted to say a big thank you for your help with my problem.  
Your advice was incredibly helpful, and I really appreciate you taking the time to assist me. You’re a lifesaver!
