Close Menu
Waste MindsWaste Minds

    Subscribe to Updates

    Get the latest news from Waste Minds.

    Loading
    What's Hot

    Theatres vs Streaming: Is the Box Office Making a Comeback?

    April 25, 2025

    Highest Paying Job Oriented Computer Courses

    April 23, 2025

    Boost Your Rankings: Optimize Website Performance for Google

    April 8, 2025
    Facebook Instagram Telegram RSS
    Facebook Instagram Threads X (Twitter) Telegram RSS
    Waste MindsWaste Minds
    Subscribe
    • Home
    • Web, Design & Code
      1. Cheatsheet & Roadmap
      2. Coding
      3. WordPress
      4. Designing
      5. Digital Marketing
      6. View All

      Cheat Your Way to Productivity: Time Management Hacks and Techniques

      July 27, 2023

      What is SQL & SQL Cheatsheet

      June 19, 2022

      Effortless WordPress Migration Guide

      March 18, 2025

      [Fixed] WordPress – Elementor Schemes Manager Error – “Elementor\Core\Schemes\Manager”

      February 1, 2025

      No-Code vs Low-Code: Which Is Best for Modern Websites?

      November 18, 2024

      Add /blog/ to WordPress Blog Permalinks Easily

      October 30, 2024

      Effortless WordPress Migration Guide

      March 18, 2025

      [Fixed] WordPress – Elementor Schemes Manager Error – “Elementor\Core\Schemes\Manager”

      February 1, 2025

      Add /blog/ to WordPress Blog Permalinks Easily

      October 30, 2024

      Optimize WordPress Sub-Menus as 2 Columns Easily using CSS

      October 7, 2024

      Principles of Design: Understanding the Fundamentals of Visual Design

      March 7, 2023

      Breaking Down the Design Process: From Idea to Execution

      March 1, 2023

      Designing for user experience: Tips and best practices

      February 26, 2023

      Build a Strong Brand Identity for Success

      October 26, 2024

      Digital Marketing in the Metaverse: Key Strategies

      October 9, 2024

      How to Use Schema Markup for Better SEO Results

      September 3, 2024

      Digital Marketing Strategies 2024: Expert Insights and Predictions

      January 18, 2024

      Boost Your Rankings: Optimize Website Performance for Google

      April 8, 2025

      Effortless WordPress Migration Guide

      March 18, 2025

      [Fixed] WordPress – Elementor Schemes Manager Error – “Elementor\Core\Schemes\Manager”

      February 1, 2025

      No-Code vs Low-Code: Which Is Best for Modern Websites?

      November 18, 2024
    • Interview Q&A
      1. Books & Entertainment
      2. Make Money
      3. View All

      Theatres vs Streaming: Is the Box Office Making a Comeback?

      April 25, 2025

      Top Best Books to Master CSS

      May 14, 2022

      Best Websites to Watch Cartoons for Free

      August 27, 2021

      Start Your E-Commerce Store with No Inventory

      March 5, 2025

      AI Tools for Blog Income

      September 7, 2024

      Unlocking Niche E-commerce: Profitable Strategies & Markets

      March 29, 2024

      [Guide] Online Course Success Strategies: Building Your Empire

      January 20, 2024

      Highest Paying Job Oriented Computer Courses

      April 23, 2025

      Nurturing Workplace Mental Health: Strategies and Employee Narratives

      January 22, 2024

      Mastering the Interview Follow-Up: Stand Out After Interview

      August 11, 2023

      Virtual Interviews: Mastering Remote Hiring 2023

      August 7, 2023
    • Lifestyle
    • Others
    • Project Ideas
    • Reviews
    • Tech Updates
      1. Extensions
      2. View All

      Top Chrome extensions for productivity and efficiency – Part 1

      February 26, 2023

      HTTP and HTTPS, TLS Types & SSL Installation Guide

      December 7, 2024

      Top AI Tools: Essential Technologies for Every Industry

      September 9, 2024

      Top AI Tools for Startups to Boost Growth

      September 8, 2024

      Adobe MAX Innovations: Project Stardust, See-Through, Primrose – Part 1

      October 30, 2023
    • Contact
    Waste MindsWaste Minds
    Home » Add /blog/ to WordPress Blog Permalinks Easily
    Wordpress No Comments

    Add /blog/ to WordPress Blog Permalinks Easily

    Vijay KarthikBy Vijay KarthikOctober 30, 2024Updated:April 6, 20255 Mins Read20 Views
    Facebook Twitter Pinterest LinkedIn Tumblr Email Reddit VKontakte Telegram WhatsApp Copy Link
    Add /blog/ to WordPress Blog Permalinks Easily Featured Image
    Share
    Email Copy Link Facebook Twitter WhatsApp LinkedIn Telegram Pinterest

    Optimizing WordPress blog permalinks by adding “/blog/” or “/article/” to your URLs can streamline site structure, improve SEO, and enhance user experience. This guide offers a step-by-step method to customize your WordPress blog permalinks, ensuring your blog posts are clearly organized without affecting other content types on your website.

    Contents hide
    1 1. Introduction to WordPress Blog Permalinks
    2 2. Benefits of Adding “/blog/” or “/article/” to WordPress Blog Permalinks
    3 3. How WordPress Manages Blog Permalink Structure by Default
    4 4. Step 1: Configuring Blog Permalinks in Settings
    5 5. Step 2: Using WPCode Lite for Custom Code Insertion
    6 6. Step 3: Setting Up Custom Post Type UI Plugin for Other Content Types
    7 7. Step 4: Adding Custom PHP Code in WPCode Lite
    7.1 “/blog/” – Slug:
    7.2 “/article/” – Slug:
    8 8. Understanding the PHP Code of above Permalink Rules
    9 9. Separating Custom Post Types from Blog Permalinks
    10 10. Testing and Finalizing the WordPress Permalink Setup
    11 11. Conclusion: WordPress Blog Permalinks for Better Navigation

    1. Introduction to WordPress Blog Permalinks

    WordPress blog permalinks are the permanent URLs used for blog posts, helping users and search engines understand site structure and content. Customizing these permalinks is an effective way to organize posts, support SEO, and ensure a smoother user experience.

    2. Benefits of Adding “/blog/” or “/article/” to WordPress Blog Permalinks

    By adding “/blog/” or “/article/” to your WordPress blog permalinks, you can:

    • Improve search engine optimization by indicating blog-specific content.
    • Make your URLs more intuitive and organized, enhancing site navigation.
    • Clearly distinguish blog posts from other custom content types, such as services or galleries.

    3. How WordPress Manages Blog Permalink Structure by Default

    WordPress offers various permalink structures like:

    • /%postname%/ (post title only)
    • /category/postname/ However, adding a unique base like “/blog/” or “/article/” specifically for blog posts requires additional setup and customization using plugins and custom code to ensure other post types aren’t affected.

    Add /blog/ to WordPress Blog Permalinks Easily

    4. Step 1: Configuring Blog Permalinks in Settings

    To begin customizing your blog permalinks:

    1. Go to Settings > Permalinks in your WordPress dashboard.
    2. Select “Post name” (/%postname%/) for a clean URL structure.
    3. Save the changes, setting the foundation for adding “/blog/” or “/article/” to your blog post URLs.

    5. Step 2: Using WPCode Lite for Custom Code Insertion

    To safely add custom PHP code to WordPress, use the WPCode Lite plugin:

    1. Install WPCode Lite from the WordPress plugin repository.
    2. Activate the plugin from your dashboard.
    3. WPCode Lite allows you to insert PHP snippets, making it a reliable tool for customizing WordPress blog permalinks without modifying theme files.

    6. Step 3: Setting Up Custom Post Type UI Plugin for Other Content Types

    For websites with custom post types like “Gallery” or “Services,” the Custom Post Type UI plugin is invaluable:

    1. Install and activate Custom Post Type UI.
    2. Go to CPT UI > Add/Edit Post Types.
    3. Set up additional post types, such as “Gallery”

    7. Step 4: Adding Custom PHP Code in WPCode Lite

    Once the plugins are ready, add PHP code to WPCode Lite to implement “/blog/” or “/article/” in your WordPress blog permalinks:

    1. Open WPCode Lite and create a new PHP snippet, then paste the following code:
    “/blog/” – Slug:
    // Rewrite Rules for /blog/ Slug
    function THEME_SLUG_posts_add_rewrite_rules() {
        add_rewrite_rule('^blog/page/([0-9]{1,})/?$', 'index.php?post_type=post&paged=$matches[1]', 'top');
        add_rewrite_rule('^blog/([^/]+)/?$', 'index.php?post_type=post&name=$matches[1]', 'top');
    }
    add_action('init', 'THEME_SLUG_posts_add_rewrite_rules');
    
    
    // Change Post Links Safely for /blog/ Slug
    function THEME_SLUG_posts_change_blog_links($post_link, $post){
        if(is_object($post) && $post->post_type == 'post'){
            
            if ($post->post_status === 'publish') {
                // Published Post URL
                return home_url('/blog/' . $post->post_name . '/');
            }
            
            // Draft / Pending / Preview — Default URL
            return $post_link;
        }
        
        return $post_link;
    }
    add_filter('post_link', 'THEME_SLUG_posts_change_blog_links', 10, 2);
    
    “/article/” – Slug:
    // Rewrite Rules for /article/ Slug
    function THEME_SLUG_posts_add_rewrite_rules() {
        add_rewrite_rule('^article/page/([0-9]{1,})/?$', 'index.php?post_type=post&paged=$matches[1]', 'top');
        add_rewrite_rule('^article/([^/]+)/?$', 'index.php?post_type=post&name=$matches[1]', 'top');
    }
    add_action('init', 'THEME_SLUG_posts_add_rewrite_rules');
    
    
    // Change Post Links Safely (Handle Draft/Preview)
    function THEME_SLUG_posts_change_blog_links($post_link, $post){
        if(is_object($post) && $post->post_type == 'post'){
            
            if ($post->post_status === 'publish') {
                // For Published Posts — Custom Slug
                return home_url('/article/' . $post->post_name . '/');
            }
            
            // For Draft/Preview — Use Default Link
            return $post_link;
        }
        
        return $post_link;
    }
    add_filter('post_link', 'THEME_SLUG_posts_change_blog_links', 10, 2);
    
    1. Save and activate the snippet. This code effectively adds “/blog/” or “/article/” to WordPress blog permalinks for all blog posts, creating a distinct, SEO-friendly URL structure.

    8. Understanding the PHP Code of above Permalink Rules

    The PHP code of above permalinks does two main things:

    • Rewrite Rules: The THEME_SLUG_posts_add_rewrite_rules() function establishes rules to redirect URLs under “/blog/” directly to blog posts.
    • Custom Post Links: The THEME_SLUG_posts_change_blog_links() function appends the “/blog/” prefix to post URLs, ensuring a unique, user-friendly permalink structure.

    9. Separating Custom Post Types from Blog Permalinks

    Using Custom Post Type UI ensures WordPress blog permalinks remain exclusive to blog posts. Custom post types like “Gallery” or “Services” will retain their unique structures, making site organization clearer and more manageable.

    10. Testing and Finalizing the WordPress Permalink Setup

    1. Flush Rewrite Rules by visiting Settings > Permalinks and clicking “Save Changes.”
    2. Test URLs to confirm blog posts are under “/blog/” or “/article/” while custom post types maintain their distinct paths.
    3. Ensure your SEO plugin, like Yoast SEO or All in One SEO, aligns with your WordPress blog permalinks setup to avoid any negative SEO impact.

    11. Conclusion: WordPress Blog Permalinks for Better Navigation

    Customizing WordPress blog permalinks by adding “/blog/” or “/article/” to URLs not only enhances site structure but also supports SEO and user experience. With plugins like WPCode Lite and Custom Post Type UI, alongside custom PHP code, you can create a well-organized, SEO-friendly WordPress site that guides users through your blog content intuitively.

    By following this setup, your WordPress blog permalinks will be organized, clearly separated from other content types, and optimized for search engines, making your site easier for both visitors and search engines to navigate.

    blog optimization blog permalinks blog SEO blog URL custom permalinks Custom Post Type UI permalinks PHP code rewrite rules SEO SEO structure SEO-friendly URLs site organization URL structure user-friendly URLs website navigation Wordpress WordPress customization WordPress development Wordpress Plugins WordPress posts WordPress setup WordPress tips WP blog WPCode Lite
    Share. Email Copy Link Facebook Twitter WhatsApp Telegram Pinterest LinkedIn Tumblr Reddit
    Avatar of Vijay Karthik
    Vijay Karthik
    • Website
    • Facebook
    • X (Twitter)
    • Instagram

    Entrepreneur & CEO | Crafting Digital Experiences | Code Magician (Web Dev) | Online Marketing Maven | Business & Project Analyst.

    Related Posts

    Wordpress 6 Mins Read37 Views

    Effortless WordPress Migration Guide

    By Vijay KarthikMarch 18, 2025Updated:April 8, 2025
    Wordpress 4 Mins Read51 Views

    [Fixed] WordPress – Elementor Schemes Manager Error – “Elementor\Core\Schemes\Manager”

    By Vijay KarthikFebruary 1, 2025Updated:April 8, 2025
    Coding 5 Mins Read26 Views

    Optimize WordPress Sub-Menus as 2 Columns Easily using CSS

    By Vijay KarthikOctober 7, 2024Updated:October 9, 2024
    Leave A Reply Cancel Reply

    Search
    Follow Us on Social
    • Facebook
    • Instagram
    • Threads
    • Twitter
    • Telegram

    Subscribe to Updates

    Get the latest news from Waste Minds.

    Loading
    Editors Picks

    Negotiating Your Salary: Dos and Don’ts

    July 21, 2023

    Celebrate Diwali: Traditions, Stories & Gifts

    October 31, 2024

    Black Friday & Cyber Monday Hosting Deals & Offers 2022

    November 18, 2022

    Overcoming Social Anxiety: Tips for Introverts and Extroverts

    October 28, 2024

    Overview Of The Union India Budget 2023

    February 5, 2023
    Top Reviews
    93
    Reviews

    WP Rocket – WordPress Cache Plugin Review

    By Vijay Karthik
    93
    Reviews

    WP Engine Review

    By Vijay Karthik
    90
    Reviews

    Elementor Review: Unleashing the Power of Visual Website Building

    By Vijay Karthik
    Categories
    • Books & Entertainment (3)
    • Interview Q&A (7)
    • Lifestyle (24)
    • Make Money (10)
    • Others (2)
    • Project Ideas (6)
    • Reviews (11)
    • Tech Updates (20)
      • Extensions (1)
    • Web, Design & Code (42)
      • Cheatsheet & Roadmap (2)
      • Coding (18)
        • Wordpress (13)
      • Designing (3)
      • Digital Marketing (16)
    Archives
    • April 2025 (3)
    • March 2025 (2)
    • February 2025 (3)
    • December 2024 (2)
    • November 2024 (3)
    • October 2024 (8)
    • September 2024 (5)
    • August 2024 (1)
    • July 2024 (3)
    • June 2024 (1)
    • March 2024 (1)
    • January 2024 (4)
    • December 2023 (2)
    • November 2023 (3)
    • October 2023 (3)
    • August 2023 (12)
    • July 2023 (16)
    • March 2023 (3)
    • February 2023 (9)
    • January 2023 (1)
    • November 2022 (1)
    • October 2022 (1)
    • July 2022 (1)
    • June 2022 (6)
    • May 2022 (6)
    • April 2022 (2)
    • March 2022 (4)
    • October 2021 (3)
    • September 2021 (1)
    • August 2021 (1)
    • July 2021 (4)
    • March 2021 (1)
    • December 2020 (1)
    • November 2020 (1)
    • October 2020 (1)
    Advertisement
    Top Reviews
    8.2

    Screpy SEO Tool Review

    November 23, 2023
    8.6

    Reseller Club Hosting Review

    August 12, 2023
    9.3

    WP Engine Review

    August 4, 2023
    9.0

    Elementor Review: Unleashing the Power of Visual Website Building

    July 23, 2023
    8.8

    Contabo Hosting Review

    March 3, 2023
    Latest Post

    Theatres vs Streaming: Is the Box Office Making a Comeback?

    April 25, 2025

    Highest Paying Job Oriented Computer Courses

    April 23, 2025

    Boost Your Rankings: Optimize Website Performance for Google

    April 8, 2025

    Effortless WordPress Migration Guide

    March 18, 2025

    Start Your E-Commerce Store with No Inventory

    March 5, 2025

    Subscribe to Updates

    Get the latest news from Waste Minds.

    Loading
    Waste Minds
    Facebook Instagram Threads X (Twitter) Telegram RSS
    • Privacy Policy
    • Terms and Conditions
    Copyright © 2021-2025 - Waste Minds. All Rights Reserved.

    Type above and press Enter to search. Press Esc to cancel.