• Resolved lbrand309

    (@lbrand309)


    How do I find where WordPress is checking URLs when I try to make a slug change? The target URL (sgtclean.com/1073) loads a 404 (when I don’t have the redirect active – this is a live campaign, so it has to load).Everything is up to date, there are no pages in the trash, no drafts with the target URL.

    WordPress won’t let me set the slug to 1073, when I save it appends the -2. If I create a new page and try to apply the 1073 slug it automatically does -3. I can manually set the new page’s slug to 1073-1 and that will save. I can’t figure out what’s going on. Does anyone have any direction for how to troubleshoot?

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • After deleting the previous page, did you also delete the trash bin? As long as this page or its data set is still there (also in the trash), the slug is occupied and cannot be assigned again.

    Thread Starter lbrand309

    (@lbrand309)

    There are no pages in the trash.

    Hello, this could be related to https://wordpress.stackexchange.com/questions/481/can-i-use-a-number-for-a-post-page-slug where numeric slugs for pages are not allowed and thus suffixed with ‘-2’.

    Thread Starter lbrand309

    (@lbrand309)

    Wouldn’t such an item load when entering the URL?

    The page with the numeric slug will load, but first the slug would automatically be suffixed by a ‘-2’ as soon as you save the page.

    I tried in a local dev environment (WP 6.3.1, Twenty Twenty Three theme): used quick edit to change the slug for ‘Sample Page’ from ‘sample-page’ to ‘1000000’, and after I click the Update button, I checked the slug and it was saved as ‘1000000-2’. When I visit ‘Sample Page’, the URL shows ‘/1000000-2/’, and if I change the URL to ‘/1000000/’ I get a 404 error.

    I did a similar experiment with the default ‘Hello world!’ blog post — changing the slug ‘hello-world’ to ‘2000000’ and after saving the slug was saved as ‘2000000-2’, so it looks like even posts are not allowed to use numeric slugs. The post ‘Hello world!’ loads with a URL of ‘/2000000-2/’ and changing it to ‘/2000000/’ redirects me back to ‘/2000000-2/’.

    My permalinks settings throughout these tests were set to Post name.

    There is a plugin that might help with your use case, but it has not been updated for years: https://www.ads-software.com/plugins/allow-numeric-stubs/ so please test in a development or staging environment first, and make a backup of your test environment too. Good luck!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Can’t change slug to unused URL’ is closed to new replies.