After you finish creating a new post for your WordPress site, you’ll want to publish it for your waiting audience. However, instead of having a short, clean URL, you may notice that the permalink contains a “-2” at the end. When you’re trying to make your content look credible, this can be a frustrating error.
Fortunately, you can easily remove the “-2” from your WordPress URLs. You’ll simply need to locate the duplicate item and update it with a unique slug. Then, you won’t have to worry about conflicting content that may confuse your readers.
In this post, we’ll explain what WordPress permalinks are and why they might contain a “-2.” Then, we’ll show you how to remove -2 from WordPress URLs in three simple steps. Let’s get started!
Check Out Our Video Guide On How To Remove the -2 From a WordPress URL
An Introduction to WordPress Permalinks and the -2 Error
For every page or post on your WordPress site, there will be a unique permalink. This is the complete link that visitors can use to find the published content. In a permalink, you’ll find a domain name, followed by a custom slug for the page.
For instance, if you create a new page named ‘Testing Page’, here’s how your full permalink could look:
www.exampledomain.com/testing-page
However, you may notice that WordPress added extra characters to this URL. As you’re editing the post, its permalink could end up containing a “-2” at the end:
www.exampledomain.com/testing-page-2
Even if you try to remove the “-2” and save the post, it will add the number back into the slug. When you’re trying to keep your permalinks as short and clean as possible, this can be frustrating.
Why Your WordPress URL Might Have a -2
Essentially, the “-2” WordPress permalink error happens when you already have another item with that unique permalink. If you’re seeing a “-2,” you likely duplicated another post, page, or media file that exists in your website files.
In WordPress, each post, page, or media file will have an automatically generated permalink. If you try to upload a similar image or create a similar post, you may inadvertently copy this URL. To prevent any duplication, WordPress differentiates the new item by adding a “-2.”
It’s important to note that this will mainly occur for published items. You can add new post or page drafts with the same titles, but the published versions will automatically implement different slugs:
WordPress does this to redirect visitors to a single page instead of having two of the same URL paths. However, you may want to shorten the permalink by removing “-2.”
Why You May Want to Remove -2 From WordPress URL
If you’re familiar with Search Engine Optimization (SEO), you likely already know the importance of cleaning up your permalinks. According to Google, it’s best to keep your URLs as simple as possible. Any extra characters that are confusing to humans can hurt your SEO.
Although “-2” isn’t as noticeable as affiliate link data, for example, it can be beneficial to remove it. By limiting your permalinks to the main keywords, you can make sure your links are clear and easy to read.
When users can understand your links, they may be more likely to click on them. Additionally, short, clean links can often appear more credible and trustworthy. Ultimately, limiting any extra information in your permalinks can help drive more traffic to your website.
How To Remove the -2 From a WordPress URL (In 3 Steps)
After you inadvertently duplicate an item on your site, WordPress may add unnecessary characters to the end of your permalinks. To fix the problem, let’s discuss how to remove “-2” from WordPress URLs.
Step 1: Locate the Original Item
Since the “-2” permalink results from duplicated items, you’ll first need to locate the original post, page, or media file. For a post or page, open a browser window and enter the original URL that you’re trying to use. This will open the content that currently exists on your website.
For example, you may be trying to use “www.domain.com/test.” If WordPress updates this to “www.domain.com/test-2’,” search for the original permalink to see what’s there:
Alternatively, it may not be published. To find the original item’s draft, search through your site’s pages, posts, and custom post types. WordPress makes this easy with its search box feature:
It’s also important to check whether the item has been deleted. For your pages, posts, and post types, be sure to click on the Trash link and search for the original item:
If you only experience this problem with your pages or posts, continue to the following step. However, this can also occur with media files. To locate the media that is causing the issue, go to the Media Library and search for it:
If you’ve gone through these steps and you can’t locate the right file, you may need to search your database. With a Kinsta hosting account, you can use the search and replace feature in the MyKinsta dashboard.
You may want to try this out in a staging environment first to avoid any permanent damage to your website (in the case that you delete or change something by mistake). To get started, click on Sites and select the site you’re working on.
From the list of tabs on the left-hand side, select Tools. Next, find Search and replace:
In the pop-up, search for the item you’re looking for. You can also use the Replace box to enter a new URL:
Once you’ve found the original source of the permalink, it’s time to delete or edit it. This way, you can remove “-2” from WordPress URLs.
Step 2: Change the Original Permalink
After you locate the original published page or post, you’ll see an Edit option at the top of the page. Click on this to open the WordPress editor:
If you don’t need this item, you can delete it. In the right panel, select Move to trash:
On the other hand, this post may contain crucial information that you’ll want to save for later use. To avoid deleting it altogether, you can simply change its current permalink. You’ll need to find the Permalink section and update the URL slug:
If the post or page was in the trash, you’ll need to restore it first. Then, you can go through the same process of updating the permalink:
For duplicate media files, you can hover over them and click on Delete Permanently. However, if you need to use them, select Edit instead:
At the top of the editing page, hit Screen Options. Then, check the box next to Slug to make those settings visible:
Scroll down to the new Slug section. Here, enter a new URL slug that’s different from any other items in your Media Library:
After you hit Update, this will save the new slug. Now, you can go back to the new item and use the permalink you initially wanted.
Step 3: Update the New Item’s Permalink
Once you’ve removed the old permalink, you’re ready to remove “-2” from your WordPress URL. For new posts or pages, you can click on Quick Edit. Under Slug, simply delete the “-2”:
Next, hit Update. If you successfully completed the previous step, your change won’t be reversed when you attempt this. Meaning, your new content will have a clean, short URL without the extra characters:
If you’re editing a media file, open the new image. Then, scroll down to Slug and enter the original slug you wanted to use:
After you remove “-2” from WordPress URLs, you’ll only have unique, readable permalinks for all your posts, pages, media files, and custom post types!
Summary
If you want to start improving your search traffic, it’s important to focus on SEO. By cleaning up the extra characters in your permalinks, you can maximize your credibility and help ensure that users click through to your content.
To remove “-2” from WordPress URLs, you can search your posts, pages, and Media Library to locate where the original permalink came from. After you delete this item or update its slug, you can start using the old link.
In some cases, you’ll need to search your database for the original file. With Kinsta hosting, you can make these searches directly from your MyKinsta dashboard. This can prevent you from working with any code!