Permalinks in WordPress should always be unique. WordPress doesn't allow different Posts or Pages to have the same URL. Because of that, WordPress will insert a suffix number at the end of the actual Post/Page URL.
Example:
First Page URL:
https://my-domain.com/my-page-name
Second Page URL:
https://my-domain.com/my-page-name-2
If there are one or more Posts/Pages with the same slug
WordPress will add a numbered suffix after the actual Post/Page URL.
That indicates that at least one Post or at least one Page uses the same slug
.
Definition: A slug
is part of the URL added after the domain name. WordPress automatically creates the slug
based on the Post/Page title.
Remove the suffix number from the page's/post's URL
Ensure that there is no other published post or page with the same
slug
Check the Trash Page and ensure no post or page uses the same
slug
Ensure that no image that is uploaded to the Media Library (WordPress →Media Library) uses the same
name
as the Post/Page's name that displays the suffix number
If any of the above is true, set unique names for those Pages/Posts.
Pro tip: Each image that is uploaded should be named to describe the page/area where it has been uploaded. To avoid creating suffix numbers, add the -img
after the actual image name.
Example:
about-us.jpg
used on the About Us page should be renamed to about-us-img.jpg
How to change the slug of an existing page/post
From Dashboard → Pages load the page in question
From the Right Sidebar, click on the URL of the page
Manually change the
slug
Repeat this process for all pages or posts that have the suffix number added.
How to change the name of an image from the Media Library
Go to WordPress Dashboard → Media →Library
Use the Search field to search for the image name
Click on Edit
Download the Image file to your local computer by clicking on the Download file link
Delete the image from your server
Change the image name - ensure that the new image name is unique
Upload the image back (with the new name)
If the previous image was used in any of your layouts, replace it with the new image.