Imagine sharing a blog post called “10 Tips for…” only to have the URL end in a string of meaningless numbers. That URL doesn’t tell users or search engines about the article’s contents.
That’s why Google’s SEO starter guide encourages the use of simple, readable URLs.
Some beginners choose the WordPress setting that uses numbers in URLs only to discover later that it’s bad for SEO. We’re often asked about the best way to fix this.
In this article, we will show you how to get rid of numbers from WordPress URLs and use human-readable permalinks instead.
Why Remove Numbers From WordPress URLs?
When it comes to setting up your WordPress website URLs, it’s important that they are SEO-friendly and help explain your article to visitors.
Adding numbers to a URL doesn’t hurt your WordPress SEO or keyword rankings. However, it makes it more difficult for search engines to understand the post. Similarly, your users can also have a hard time finding the right content if it only contains numbers.
Here’s an example of an SEO-friendly URL that doesn’t have any numbers:
https://www.wpbeginner.com/start-a-wordpress-blog/
On the other hand, here’s what your URL would look if it only had numbers, like a post ID:
https://www.wpbeginner.com/?p=11245
As you can see, links with a keyword or a phrase are much easier to understand and easier to find than numbered URLs.
Another benefit of removing numbers from URLs is that you don’t have to redirect a blog post whenever the content is updated. For instance, it’s an SEO best practice to remove numbers like the year, day, or the total number of items in a list post from the URL.
That said, let’s see how to remove numbers from a WordPress URL.
Video Tutorial
If you’d prefer written instructions, then just keep reading.
Removing Numbers From WordPress Permalink URLs
WordPress has built-in support for SEO-friendly URL structures.
All you need to do is open the Settings » Permalinks page in the WordPress admin area and choose a URL structure for your site.
You’ll see different options for your permalinks. These include a Plain structure where your URL contains the post ID, a day and name structure, a month and name structure, a numeric structure, and a post name structure.
We recommend choosing the ‘Post name’ structure that shows your post title in the URL because it is SEO-friendly and will help others discover your site in search engines.
Once you have set up permalinks, you just need to save your changes.
WordPress will now automatically change URLs for all your previous posts as well. Don’t worry if you have posted the older URLs somewhere because WordPress will automatically redirect those users to new URLs.
Removing Numbers From a Post or Page Slug
Even though you are using permalinks now, you may still want to get rid of numbers in your blog post URL. The most common reason for this is when you publish a post with no title or the title contains a number like a year.
Remember, WordPress chooses the text to display in the URL from your post’s title, so if your post does not have a title or contains a year, then WordPress will use it in the URL. Instead of the post number, you can manually tell WordPress what to use in the URL.
Remove Numbers from URL Slug in the WordPress Block Editor
To edit the URL of any content on your site, you need to edit your blog post or page.
Once you are in the WordPress block editor, you can click on the gear icon in the top right corner and open the settings panel.
Next, simply scroll down to the Permalink section in the settings panel and edit the URL Slug. When you don’t have a title for a blog post, it will show the post ID by default.
In the screenshot above, WordPress is using the current post ID 45
as the URL slug.
You can edit that or simply enter a title for your blog post, and your URL slug will automatically change to your post title.
When you are done, don’t forget to Publish or Update your blog post.
Remove Numbers from URL Slug in the WordPress Classic Editor
If you are using the WordPress classic editor, then you also edit your post permalink and remove numbers.
First, add a new blog post or edit an existing page.
When you are in the classic editor, you will see your post’s URL with an ‘Edit’ button just below the post title.
Clicking on the ‘Edit’ button will make the URL editable. This editable part is called the post slug. You can enter the text you want to use as a post slug in the URL and remove the numbers.
What About Numbers in Duplicate Posts and Pages?
Sometimes even when you edit the custom slug, the -2
continues to be added to your URLs. For example, you create a new About page, and your URL looks like this:
https://yoursite.com/about-2/
Now wouldn’t you want to get rid of that -2
, and simply have /about/
? This problem occurs when you have the same slug being used already.
Check all your posts and pages to see that none has the same slug, such as /about/
. If you find one, then you need to delete it unless you are using it. More often than not, you won’t find an active page with the same slug.
This is when you need to look in the Trash folder. When you trash a WordPress post or page, it is not entirely deleted. It sits in the Trash for 30 days before it gets permanently deleted. This is done to give you the option to restore trashed items if you accidentally deleted them.
The slug cannot be reused as long as the post or page stays in the Trash. So if you want to reuse the /about/
slug, then you must delete the About page sitting in the Trash folder.
Once you do that, you should be able to edit your slug, like the method shown above, and get rid of the -2
.
This technique works for categories and tags as well.
Bonus: Setting Up 301 Redirects When Changing URLs
Whenever you edit a URL slug of existing content, WordPress will create a new page or post. This will lead to duplicate content on your website with different slugs.
You don’t want that because it’s bad for WordPress SEO. That’s because search engines won’t know which content to rank, and the existing link authority won’t be passed through to the newly changed URL.
A simple solution is to set up redirection whenever you change the URL.
All in One SEO (AIOSEO) is the best SEO plugin for WordPress and has over 3 million users. It offers a powerful redirection manager that helps set up 301 redirects and catch broken links on your website.
Note: The redirection manager is available in the AIOSEO Pro license. There’s also a free version of AIOSEO you can use to get started.
All you have to do is enter the slug that you want to redirect (Source URL) and add the new changed URL (Target URL). From here, you need to select ‘301 Moved Permanently’ as your Redirect Type.
Please see our guide to creating 301 redirects in WordPress for more details.
Expert Guides on WordPress URLs
Now that you know how to remove numbers from URLs in WordPress, you may like to see some other guides related to WordPress URLs.
- Glossary: URL
- Glossary: Post Slug
- What is a Website URL (Important Parts Explained for Beginners)
- How to Create Custom Permalinks in WordPress (Ultimate Guide)
- How to Include Category and Subcategory in WordPress URLs
- How to Remove the Date From WordPress URLs
- How to Remove v=XXXX String From WordPress URLs
- How to Change Author URL Slug and Base in WordPress
- How to Remove Parent Slug From Child Page URL in WordPress
- How to Get Rid of /wordpress/ From your WordPress Site URL
We hope this article helped you learn how to remove numbers from WordPress URLs. You may also want to see our guide on how to start an online store and our expert pick of the best virtual phone number apps for small businesses.
If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.
LorriAnne
Looking at these screenshots and then looking at what I have in my WP, I believe someone’s pulling my leg with some really good photoshopped images. This tutorial is not valid.
WPBeginner Support
Our guide is using the current block editor. If you do not see the same interface there are three likely culprits. If you are using a page builder plugin that would override the default editor with some, if you are using the classic editor plugin you would see the old classic editor interface, or if you are using WordPress.com then you would see their interface instead as our articles are for WordPress.org sites.
Admin
Hussain Ali
Can we edit our website’s domain name and keep the data safe?
WPBeginner Support
Your site’s content would be safe when updating your domain for this tutorial.
Admin
Thomas
Hi,
Thank you for a very informative video / article.
I have the same issue that you talk about, where the “-2” appears on one of my sites, however, I have nothing in my trash?
Currently, this issue arises on my local server and I would love to get it fixed before I take this live. Could you help me?
WPBeginner Support
You would want to try to visit the URL without the -2 in it to see if it directs you to a page in which case you should be able to click the edit option in the admin bar at the top of your site.
Admin
pankaj
Awesome!
Thankyou!
WPBeginner Support
You’re welcome
Admin
Tamás
Hello!
I like to get WP to start the numbering on repeating slugs from 8 digits.
E.g. sample-post, then sample-post-0000001
Any idea? I don’t find anything related and would be extremeley important.
Thx!
Best
Tamas
WPBeginner Support
Sadly, at the moment we do not have a recommended method for setting that up.
Admin
Ajay
Dear Editor,
I have a question about how to remove tag from wordpress url?
old url: site.com/tag/movies
New Url : site.com/movies
How do I do that in wordpress? And how do I make the url direct from the old url?
WPBeginner Support
For the URLs, you would want to take a look at our guide here: https://www.wpbeginner.com/wp-tutorials/how-to-create-custom-permalinks-in-wordpress/
After changing your URLs, you would want to create a redirect using one of the methods here:
https://www.wpbeginner.com/beginners-guide/beginners-guide-to-creating-redirects-in-wordpress/
Admin
Bilal
Today, when I working on Login page to place Password recover form short code, I Turn of Social media Login. After that I Logout Admin and checked that, two changes observed, one is Login form shwing very small size, second is all pages showing IDs when open in browser
Now what I do to set it, in settings, Permalinks seting are ok like previous, what thing changed, which showing IDs after url.
Any solution.
WPBeginner Support
You would want to let the social media login plugin know what happened to the login form after disabling and they should be able to assist. If it is a ? followed by a number then you are likely using an ecommerce plugin that is tracking sessions so it can save the cart for the user.
Admin
Bita Gh
I have a problem in my wordpress website. my old website has been linked to my new website though an URL which I can not find. I want to delet or disable that link especially in google search. because that is linked to my old shop and old prices and people keep calling about the differences in prices. please help!
Janice Sullivan
My links are ok but on the top bar I see “All Posts | “my link name”. ‘All post’ is not part of the name of the page/blog posts or in the link? I can’t figure out how to remove it…any help out there?
Adrian McCarthy
Thank you, thats such a simple solution and works brilliantly thank you.
Sarah X
Hello. I did what all the steps you did but the 2 continues to show up in the url. I dont know what to do . i deleted and add like 3 times the same page and that number still there … :s
Whats wrong ? can you help me pls
Appreciate the attention
Sarah. from Portugal
WPBeginner Support
Hi Sarah,
When you delete a post or page in WordPress, it goes into the trash. You need to delete that page from Trash as well. Go to Pages » All Pages and you will see a row of links to sort pages according to their status (Published, Draft, Scheduled, Trash). Click on the trash to view the pages that you have deleted earlier. Once you are there you will see a link ‘Delete Permanently’ below each article clicking on it will delete the page permanently and you will be able to use that slug for your new page.
Admin
Kat Zimmer
Hi there,
I’ve combed through our site and taken all the actions you’ve suggested (permanently delete everything in the trash and ensure there is no photo/media file with that slug) and it’s STILL naming my slug with a -2 at the end. Please help!!
WPBeginner Support
Hi Kat,
Please check your pages and categories as well. Also try visiting the full url to see if there is a post, page, or attachment with the same slug.
Peter
How can I produce a list of permalinks that have “-2” at their end, so I can correct them? I have 291 posts, 48 pages, and around 50 product pages.
In addition, I have two ecommerce stores, one for Australia (/shop/bookname) and one USA (/books/bookname), and all products have permalinks. Doesn’t permalinks take notice of the rest of the URL?
Thanks,
Peter
Sarah
I deleted a post and when I went to make a new one the -2 is STILL there. Any other help?
Shaikh
I didn’t have any pages still in trash. I didn’t have a category with the same name as my page. I didn’t have another page with the same name. So I did something crazy. WP was trying to name my page as page-2, so I went to mywebsite.com/page to see what happened.
A page with a single photo popped up. I had a PHOTO with the same name as the page, and WP media manager gives photos permalinks based on the file name! Fix was to rename the photo (still keeping SEO in mind), and using the permalink editor for the page. TAH DAH! Like magic, it worked
Chrissy
Ah, I was pulling my hair out with this and what you’ve found out has solved my issue. Thanks for posting your findings, very helpful…
Janssen
is there any way to also hide the url link? for example, mysite/mypost/ instead of 192.168.0.1:8080/mypost/
Christa
I found your post because I do wonder about the following number behind all the pages and posts I have on my website which then looks like this: example.com/?v=b9610cde4c4c.
If I check the number only with google there comes my site with two pages and another very strange facebook website kind of….
I saw that someone commenting did find out about a plugin – so I deactivated all social plugins, I haven’t got hers on my site. The Permalinks are checked and correct and I didn’t find anything to change or this number, in my php. Do you have any Idea, what this could be or must I worry…?
WPBeginner Support
If you are worried about security of your site, then you can try scanning your website with Sucuri. If the URLs are getting indexed in search, then it is not good for your website’s SEO.
Admin
Christa
Hello, thanks for your reply and yes, I will check it at sucuri – good idea! I don’t understand what you mean by “if the URL’s are getting indedexed in search…” what do you mean by that?
Thank You!
Richard
I Once Had The Problem Of Seeing the -2 slug being shown for duplicate pages left in trash. However with a New Site I was Editing I was Still Having the -2 show up in title but there was not anything in my Trash For Pages. I Finally Searched My domain with the correct title I wanted and Up Popped one Of the images in my IMAGE Library that had the same name of the page I kept trying to correct. So Images with Names the same as your titles will cause this Behavior too. Just My Experience with the problem.
WPBeginner Support
Images are also stored as attachment which is a built in WordPress post type. Like all other post types attachments also have slugs. So yes if you have an attachment with slug my-first-bike and then you try to add an article with the same slug, then WordPress will add a number to the slug.
Admin
trey
Had the same problem on a page. Deactivated all plugins, quick edit of page url. and bingo it now works, tried everything to no avail before!
Paul Sadler
Unfortunately, this article is a bit simplistic as that is not always what causes the -2 to be added. While it will do it if there is already an “about” and you are adding another page or post called “about”, but it also has problems with numbers as the titles of pages.
I am creating a gallery and some of the layout is a bit manual for organization, partly as I am wrapping text around the intro and conclusion. So I called one of the pages 2015, another 2010, another 2016. Doesn’t matter what I call it, there is nothing in my trash by that name, it is entirely “new”, but WP will NOT allow it. Why? Because it knows it looks like a year and it doesn’t like numbers only in the structure.
So I can’t have “2015 / January” as my structure, it will have to have some other letter in there for the year plus of course I can’t have the “January” page every year, leaving me with a URL that will look like Y2015 / 2015-January…not very elegant I’m afraid, but seems to be the only solution other than running a custom plugin that overwrites the slugs and risks breaking all of the WP install.
Paul
Chirag Gupta
how can i remove category or tag from url…
example.com/category/mobile >>> example.com/mobile
WPBeginner Support
See our guide how to change category base prefix in WordPress.
Admin
andrew
I seem to no longer be able to add a permalink with just four digits (ie “http://example.com/1223”)
You used to be allowed to do this for posts but not pages, now you can’t do it at all and it is really messing up one of my clients sites.
Devang Sharma
Thank You very much guyz ! You don’t know how disturb i was…..
Damaris
How do you change it if you have wordpress beginner?
WPBeginner Staff
This is unusual behavior. Please deactivate all your WordPress plugins and switch to a default theme like twenty thirteen or twenty fourteen. See if your posts still have links like this. If they do then it is likely that your WordPress security is compromised.
Karon Warren
I have permalinks set up on my site with “post name” as the default setting. And that does work. However, when you actually click on the live post, it initially comes up with the permalink, but after fully loading, it has a series of numbers/letters attached to the permalink, like this: #.VB2dTCtdVW0
How do I get rid of those numbers from the actual permalink?
Janet Bauske
Karon, I had the same problem. I found the culprit was the AddThis social bookmarking widget. To remove it, go to the Plugin settings under Settings > AddThis Share > Advanced Tab and turn off the Address Bar Shares Tracking.
Cathy Sirvatka
I have been trying to figure out the number thing for a long time. Thank you for this!! I had no idea files in the trash were still using the page name!
Steve
I have the same problem (-2 at the end). I have cleared my trash, etc but I’m still having the same problem. I have an about-2 page, but no sign of an about page. Any ideas?
Rugby
Really helpful – had problem with -2 being added to my posts page and emptied trash and hey presto gone! Thanks
Theresa
sometimes the littlest things can feel like a stalemate. thanks for providing all these great tips
Michael Monday
Splendid !!! You just said it all !!! Thanks a lot for this long-sought solution to the “urgly” url I have had to deal with for months. Now my posts url looks good. Thanks a lot My Balkhi and your team
John
This is all great information! I would like to know if I can use some of what I find here to post on my site, or include in email campaigns. Specifically, referring to the badge in this post for removing numbers from urls in WP, but also would like to know if there are others available, within the confines of best practices of course.
thanks,
jag
Keith Davis
Hi Guys
I’ve got pretty permalinks set so I’ve had no problems with that but I have had the 2 appear in a couple of posts.
The first time I trashed a post and started again not realising that trashing is not enough: you have to delete it.
The second time I trashed and deleted the post but still got the dreaded 2 at the end.
No idea why that would happen.
Gretchen Louise
Is the automatic redirection of permalink styles a new feature? I still use custom .htaccess code but have had issues with it eliminating my date-based archives, too.
patty jones
Wordpress automatically redirects to the new permalinks? I have wanted to change the permalink structure of my site for a long time but worried how it would affect links that are already out there.
Our site has over 4000 posts and I figured it would kill our page rank. What are you thoughts on that many redirects?
jayism
This is an interesting post, but it does not cover how to remove the site.com/category-2/sub-category/heres-a-post.php – I have this problem, and read it happens when you create a category called software, then delete it, and create it again further down the track – the original ‘software’ remains in the DB for ‘categories’ – therefore it is forced to name the category with a -2 so the Database doesn’t have a duplicate….
The only ways I’ve read to fix this in numerous posts is going into myPHPAdmin and deleting the original ‘software’ manually! Your post has shed some light on the situation, and may have another way to get rid of the -2 fro actual categories?
Thanks,
@jaycameron of ‘Crowd-Sourced Development Initiative’ -> @Code_Collective
Karen
How excellent! That hint about the trash is a gem. And go ahead and laugh – but – I knew what pretty permalinks were – but was confused if that was what acheived with clicking the Post Name option. I’d been confused because I used to do my Pretty Permalinks using the custom option – until this new button was added. So thanks for solving that tiny mystery for me!