0

The issue was described in 1 or 2 post already but my case goes little more, since none of the mentioned causes are not my case:

  • I do not have trash

  • I checked my media and galleries

  • Putting a ridiculous name (like: "2015555555" in stead of 2015) still produce "2015555555-2"

    Do not know what to do next...

1
  • Basically, any number in the first permastruct might conflict with a year, so if your permalink settings are /%postname%/ then every integer-only title is going to be interpreted as a potential conflict with year-based archives and will get a suffix appended.
    – bosco
    Mar 27, 2017 at 20:54

1 Answer 1

1

Some things that come to mind to try:

Does this happen for all post types or just post or just custom post types? Are they hierarchical posts?

You could read through the wp_unique_post_slug function (https://developer.wordpress.org/reference/functions/wp_unique_post_slug/) to see what might be triggering the suffix.

Take a look through your database to see if there is any lingering post_meta that might be causing the duplicates (meta key = _wp_desired_post_slug).

See if there are any hooks that alter wp_unique_post_slug.

If you have a post with the slug 201555555-2 and you add a new post with the slug 201555555 does it get a -3? Is the -2 only added to number -only post titles or every post title even with only letters?

2
  • I believe a second 201555555 should produce a slug containing 201555555-3
    – bosco
    Mar 27, 2017 at 20:58
  • Yes, you're correct. The suffix is added in a do while loop and is incremented. Corrected above.
    – danbrellis
    Mar 28, 2017 at 13:00

Not the answer you're looking for? Browse other questions tagged or ask your own question.