Why does WP allow duplicate pages with the same name?

admin2025-01-07  4

I ran into an issue yesterday where I saw duplicate versions of a few different pages with the same name & path. No extra number appended to them. I deleted the duplicates which caused an issue with the nav (which I was able to fix by pointing it to the remaining pages).

Is there something off with my configuration? I wouldn't think that duplicate pages with the same name and path would be allowed.

I ran into an issue yesterday where I saw duplicate versions of a few different pages with the same name & path. No extra number appended to them. I deleted the duplicates which caused an issue with the nav (which I was able to fix by pointing it to the remaining pages).

Is there something off with my configuration? I wouldn't think that duplicate pages with the same name and path would be allowed.

Share Improve this question asked Aug 1, 2019 at 14:53 MMSIMMSI 34 bronze badges 4
  • Did you forget to mention that default theme is in use and no plugins are enabled? – Max Yudin Commented Aug 1, 2019 at 17:08
  • It's running a custom theme with several plugins enabled. I inherited the site so i'm not sure how long this issue was occurring. – MMSI Commented Aug 1, 2019 at 18:11
  • The very first thing to do is to disable all plugins, switch to any default parent theme, enable debug and error_reporting() and version update. Then check again. I don't believe WordPress allows you to use the same slug twice with no changes to the vanilla installation whether they are plugins, theme functions or core modifications. – Max Yudin Commented Aug 2, 2019 at 6:51
  • 1 As a side note, I think I've seen that there can be multiple pages with the same slug / post_name as long as they have different parent pages. E.g. /foo/bar and /baz/bar should be ok. But as top level pages or under the same parent matching slugs should not be possible by default. – Antti Koskinen Commented Aug 2, 2019 at 21:37
Add a comment  | 

1 Answer 1

Reset to default 0

I think I found the issue. It looks WPML, the translation plugin, makes a duplicate page for every translated version of a page. So we had multiples of a few pages that were translated into various languages.

Sidenote: WPML stopped working a couple months ago and none of their fixes have worked yet. So no big loss just yet.

Thanks for your help!

转载请注明原文地址:http://conceptsofalgorithm.com/Algorithm/1736260682a683.html

最新回复(0)