Is WordPress generating confusing URLs for your pages and posts, like /page_id=6
and /p=2
? Let’s solve this problem by enabling “pretty links” that correspond to your page titles.
Why WordPress Creates Permalinks with Page and Post ID Numbers
Every page and post on your WordPress site is assigned a unique ID number in the database. These IDs allow WordPress to generate dynamic links regardless of the page titles. By default, WordPress uses these IDs to create URLs for your content.
In a fresh WordPress installation, you’ll typically find permalinks like:
/page_id=2
– Sample Page/page_id=3
– Privacy Policy/p=1
– Hello World!
If you create a new page or post, its URL will include a unique ID number by default.
An example of a WordPress URL with the page ID 3.
Why Default WordPress ID URLs Are Problematic
There are several compelling reasons to change your permalink structure from the default “Plain” setting (using ID numbers) to “Pretty Links,” which are based on page names. For example, the Privacy Policy page URL should look like /privacy-policy/
instead of /page_id=3
.
- Improved User Experience
A URL that includes the page name clearly indicates the content of the link, making it easier for users to understand. - Search Engine Optimization (SEO)
Keywords in your URLs are an important ranking factor for search engines like Google and Bing. - Increased Trust
Links containing parameters like?page_id=6
can appear suspicious. Some users may avoid clicking such links due to security concerns.
How to Replace Page IDs with Page Titles in WordPress URLs
Fortunately, replacing ID numbers with readable page titles in your WordPress URLs is quick and easy.
Steps to Update Your Permalink Structure
- Log in to your WordPress Dashboard.
- Go to Settings > Permalinks.
- Choose a New Permalink Structure:
– Select “Post name” to create clean URLs based on your page or post titles.
– Pro Tip: For more advanced settings, choose “Custom Structure” and define a format, such as/blog/%postname%/
for blog posts. - Save Changes: Click the Save Changes button at the bottom of the screen.
- Clear Your Cache: If necessary, clear your site cache and browser cache to ensure the new URLs display correctly.
Choose “Post name” in Settings » Permalinks in the WordPress admin area.
That’s it! Your ID-based URLs have now been replaced with user-friendly, SEO-friendly URLs that are based on page and post names. WordPress will automatically convert your URLs to lowercase, remove invalid characters, and replace spaces with hyphens.
What Happens to Your Old ID-Based URLs?
You don’t need to update all your internal links or create 301 redirects to preserve SEO and traffic. The old ID-based URLs will still work – they’ll automatically redirect visitors to the correct “pretty link.”
Behind the scenes, WordPress continues to use page and post IDs in the backend, but you no longer have to display these IDs to your visitors.
That’s all for today!
I hope that you enjoyed this post. Subscribe to VictorDuse.com on YouTube and join our Facebook group for more crisp content on WordPress and web design.
👉 Related post: Why WordPress Adds -2 To Your URL (And How To Remove It)
👉 Free course: Create a website from scratch with Divi
0 Comments