ZoyaPatel

How to remove numbers from WordPress URLs for better SEO

Mumbai

Learn how to create SEO-friendly permalinks in WordPress by removing numbers from URLs and optimizing your post slugs.

How to remove numbers from WordPress URLs for better SEO
Illustration by Febrina Tiara

By Randy Ahmad and Yuni Utomo

Creating helpful, SEO-optimized content doesn’t stop at writing great headlines—it extends to every part of a blog post, including the URL. Many websites still overlook this detail, resulting in URLs that are filled with random numbers or unreadable structures. This makes it difficult for both users and search engines to understand what the content is about.

In this comprehensive guide, we’ll show you how to remove numbers from WordPress URLs and create clean, readable, and SEO-friendly links for your blog or website. Whether you’re launching a new site or correcting an older one, these strategies will help improve your site’s usability and SEO.

Why you should remove numbers from WordPress URLs

Using numbers in URLs—especially random ones like post IDs or duplicates—can make your links confusing and unhelpful. While having a number in a URL won’t directly harm your WordPress SEO or stop a page from ranking, it can reduce the clarity and clickability of your content.

Imagine coming across these two links:

  • https://www.example.com/?p=5123
  • https://www.example.com/start-wordpress-blog

Which one gives you a better idea of the content you’re about to read? The second URL is clearly more descriptive, user-friendly, and optimized for SEO. Google itself recommends using simple, readable URLs in its SEO Starter Guide.

By removing numbers from WordPress URLs, you not only improve how your site looks and feels to visitors, but you also help search engines better crawl and index your pages.

Choosing the right permalink structure in WordPress

To begin the process of removing numbers from your URLs, the first step is to change your WordPress permalink settings.

How to update permalinks

How to update permalinks

  1. In your WordPress dashboard, go to Settings > Permalinks.

  2. You’ll see several permalink options like:

    • Plain (?p=123)
    • Day and name (/2025/05/28/sample-post/)
    • Month and name
    • Numeric
    • Post name
  3. Select Post name as your permalink structure. This format uses the post’s title in the URL, which is clean and descriptive.

  4. Click Save Changes.

WordPress will now apply this structure to all your future posts. If you're changing the permalink on an existing site, don’t worry—WordPress automatically sets up redirects for your old URLs, ensuring that users and search engines are sent to the right place.

Editing the URL slug in the block editor

Even after setting up a clean permalink structure, some posts may still include numbers in their slugs—especially if the title includes a year or if the post had no title when first saved. In such cases, you can manually edit the slug.

Steps to edit a slug in the block editor

Steps to edit a slug in the block editor

  1. Open the post or page you want to edit.
  2. In the upper right corner, click the gear icon to open Settings.
  3. Scroll down to the Permalink section.
  4. In the URL Slug field, replace any numbers with meaningful keywords.

For example, if your current URL is:
https://www.yoursite.com/2025-update-plugins
You can change it to:
https://www.yoursite.com/update-wordpress-plugins

Steps to edit a slug

Click Update or Publish after making changes.

Editing slugs in the Classic Editor

Editing slugs in the Classic Editor

If you're using the Classic Editor plugin, you can still remove numbers from your post slugs easily.

  1. Edit your post or page.
  2. Under the title field, look for the Permalink preview and click the Edit button.
  3. Enter a new slug, removing any numbers or post IDs.
  4. Click OK, then Update the post.

This allows you to maintain SEO-friendly URLs even when you're not using the newer block editor.

Dealing with duplicate slugs and the “-2” problem

Sometimes, even after editing a slug, WordPress will automatically append a -2 at the end. This happens when a page or post with the same slug already exists, even if it’s in the trash.

For example:
https://yoursite.com/about-2/ instead of https://yoursite.com/about/

To fix this:

  1. Check whether a post or page with the desired slug is already published.
  2. If not, go to Pages > Trash or Posts > Trash.
  3. Look for an older post or page with the same slug and delete it permanently.
  4. After deletion, go back to your active post and change the slug again. This time, the -2 should disappear.

You can also use this method to clean up duplicate slugs for categories and tags in WordPress.

Bonus: Use 301 redirects to preserve SEO rankings

Changing URLs can result in broken links or lost SEO rankings if not handled correctly. That’s why it’s essential to set up 301 redirects after removing numbers from your WordPress URLs.

A 301 redirect tells search engines that a page has permanently moved to a new location and passes on most of the link equity.

Using AIOSEO for redirections

Using AIOSEO for redirections

We recommend using the All in One SEO (AIOSEO) plugin, which includes a built-in Redirection Manager (Pro version).

Here’s how to set up a redirect:

  1. Go to AIOSEO > Redirects.
  2. In the Source URL field, enter the old URL with the number.
  3. In the Target URL field, enter the new, clean URL.
  4. Set the redirect type as 301 Moved Permanently.
  5. Click Add Redirect.

This ensures that visitors and search engines are properly directed, preserving your SEO efforts.

If you’re using the free version of AIOSEO or another SEO plugin, some may offer basic redirection features as well. Always make sure to test your redirects after setting them up.

Final thoughts

Using SEO-friendly URLs improves your site’s visibility and makes it easier for users to understand what your content is about. By taking the time to remove numbers from WordPress URLs and choosing readable slugs, you strengthen your site’s SEO foundation.

If you’ve been using number-based URLs or have inherited a site with poor permalink structures, now is the perfect time to make the change. With WordPress’s built-in features and a good redirection plugin like AIOSEO, it’s easier than ever to clean up your URLs and boost your rankings.

Let your URLs tell a story—not just to your visitors, but to search engines too.

More in WordPress

Ahmedabad