WordPress / 2 MIN READ
Nested Pages & Slugs
Managing nested pages and slugs in WordPress
From the original Fervor library. Examples may use older package versions.
Let’s create subcategory slugs with pages in WordPress. Pages are a bit different from posts because they are typically used for static content. However, you can create a nested page structure to achieve a similar effect. Here’s how to do it:
Step 1: Create Parent and Child Pages
-
Login to your WordPress Dashboard: Open your site and add
/wp-adminto the URL. -
Create a Parent Page:
- Go to
Pages>Add New. - Enter the title for your parent page (e.g., “Example”).
- Publish the page.
- Go to
-
Create a Child Page:
- Go to
Pages>Add New. - Enter the title for your child page (e.g., “Slug of Site”).
- In the
Page Attributesbox on the right, select the parent page you just created from theParentdropdown (e.g., “Example”). - Publish the page.
- Go to
Step 2: Verify the URL Structure
-
View the Pages:
- Go to
Pages>All Pages. - Find the parent page (“Example”) and the child page (“Slug of Site”).
- Go to
-
Check the URL:
- Open the child page (“Slug of Site”) on your site.
- The URL should now be structured like
www.yoursite.com/example/slug-of-site.
Step 3: Adjust Permalink Settings (if needed)
- Go to Permalinks Settings: Navigate to
Settings>Permalinks. - Select a Permalink Structure: Usually, the default structure works well for pages. But ensure that it supports nested pages. Typically, it’s
/%postname%/. - Save Changes: Don’t forget to hit the
Save Changesbutton at the bottom.
Step 4: Add More Nested Pages (Optional)
-
Create More Child Pages:
- Go to
Pages>Add New. - Enter the title for another child page.
- In the
Page Attributesbox, select the appropriate parent page. - Publish the page.
- Go to
-
Check the Nested URL:
- Open the newly created child page.
- The URL should reflect the nested structure, like
www.yoursite.com/example/another-slug.
Step 5: Troubleshoot Common Issues
- Flush Permalinks: If the nested URLs aren’t showing up correctly, go back to
Settings>Permalinksand hitSave Changesagain to flush the rewrite rules. - Check Page Attributes: Make sure the parent page is correctly assigned in the
Page Attributesbox.
Bonus Tips
- SEO and Readability: Keep your page titles and slugs descriptive yet concise for better SEO and user experience.
- Organize Content: Use parent and child pages to logically organize your site’s content.
And there you have it! Now you can create beautiful, nested page structures in WordPress, giving your site a neat and organized look. Happy structuring! 🎉
Keep your curiosity going.Explore more WordPress →