Skip to main content
All CollectionsTroubleshooting
Fix the warning: Duplicate slugs
Fix the warning: Duplicate slugs

If you encounter this error this article will help you fix it.

Jonas Lindemann avatar
Written by Jonas Lindemann
Updated over 2 months ago

When generating pages in LPagery, you might encounter a duplicate slug warning. This warning occurs when two or more pages are set to be created with the same URL slug. WordPress does not allow duplicate slugs, so this can cause issues with your page URLs.


Why It Happens

The warning is triggered when multiple pages are assigned the same slug during the page creation process. If ignored, WordPress will automatically append “-2” or another number to the slug to make it unique, which may not be ideal for SEO or user experience.


How to Fix It

1. Adjust the URL Slug in the Source File

  • Before generating the pages, adjust the URL slug in your source file or page creation settings to ensure each slug is unique.

  • Use placeholders like {service} or {city} in the slug field to generate unique URLs for each page.

2. Use Dynamic Placeholders for Slugs

  • Add dynamic placeholders to the URL Slug field during page creation. This ensures that LPagery automatically generates a unique slug for each page.

  • Example:
    Instead of using the same static slug, use a placeholder like my-service-in-{city}, which will produce a unique slug for each city.

3. Regenerate Pages

  • After adjusting the slugs, recreate the pages to ensure the issue is resolved and all slugs are unique.

Did this answer your question?