How to Remove Numbers From WordPress URLs

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.

How to remove numbers from WordPress URLs

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.

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.

Update permalinks

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.

Change slug in block editor

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.

Post title as slug

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.

Edit post slug in classic editor

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.

Set up redirection in AIOSEO

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.

Lượt xem: 24

Trả lời

Email của bạn sẽ không được hiển thị công khai. Các trường bắt buộc được đánh dấu *