Just set your custom permalink structure to:
/theblog/%postname%/
If you have any custom post types used on your site, you’ll need to make sure that they don’t get the /theblog/ prepended to their URLs. To remove it, simply set with_front to false where the custom post types are registered:
'rewrite' => array('slug' => 'portfolio', 'with_front' => false),
You also need to flush the WordPress rewrite rules after making this change – just go back to Settings > Permalinks save again the permalink.
You are done.
Related Posts:
- Change the “page” slug in pagination
- Change author base slug for different roles
- Using custom/dynamic “slug” for a page
- Display posts with author in the url with custom post types
- How to seamlessly redirect between different archive and singular slugs?
- How to add dot(“.”) in post slug
- How to change default page slug?
- Handle category name URL rewrite before different post type slugs
- How to change ?lang=cn into /cn/
- custom htaccess rewrite rule for page
- Why is there /index.php/ in all my links? How do I remove it?
- Multiple Permalinks for Same Post
- Adding more pages to author pages
- Load a template page based on part of slug in wordpress
- Removing “category” from URLs then “add_endpoint()” won’t work…
- How do I change attachment slug from name to id
- Access files at new location using old file paths
- Adding special characters to slug?
- Rewrite URLs – Custom Post Type – Post Slug, Taxonamy Slug
- Preserve old website URL structure after migrating to WordPress
- How to change the Author Slug from Username to Nickname and deal with Special Characters
- How to change custom post type slug
- Disable WordPress from changing URL slug when post is published
- Using URL rewrite to add custom URL for custom post type
- One off rewrite for single post-type slug (show normal page with same URL instead)
- Can’t use a specific custom URL (slug)?
- How to transform multiple parameter URL to clean URL
- Make the home page’s slug visible in the browser’s URL bar
- Trying to add array of paths to post permalink
- Changing the wordpress default search url to something like – …example.com/search?query=keyword
- How to add dot(“.”) in post slug
- WordPress is adding “category” word before my actual category name in url (and this is unsolicited)
- Change author base and slug in author link
- WordPress numeric (yearly) page names / disable yearly archives
- Post & Page with same slug
- How to add 2 variable rewrite rule?
- taxonomy term in URL slug won’t forward to the correct term for custom post like it does for default categories/normal posts
- Remove Page Slug from URL
- Needed to change slug to access page
- Pagination posts. Url format
- Change the slug ( url ) to a sequence number starting from 0 in the custom record type?
- Rewrite Slug for CPT Archive Pages to Plural Name of Slug
- How to add custom rewrite rule to .htaccess?
- Problem with add_rewrite_rule and pagination (paged and page query_vars)
- Custom Permalinks for Blog Posts Only
- Detect page type by url (Archive, single, page, author,…)
- How to show the same content on multiple URLs?
- Using a page template without a page
- Overwrite rewrite-slug of built in post-type ‘post’
- URL rewrites and pagination
- Rewrite rules goes away
- unexpected problem in url rewrite
- Need to make a php file inside theme accessible via url
- Remove child category from URL
- Rewrite loading custom template file but is_home() returns true, and there’s no 404
- Rewrite rule for admin-ajax.php
- Rewrite WordPress Custom URL
- How to check current URL for endpoint in a template file?
- Single Redirection Rule for Pages and Archive links
- Home page with Polylang redirects to other page [closed]
- expecting 404 but redirecting to post with url subdirectory in post title
- Custom user profile URLs
- How to remove slugs from multiple custom post types
- Preserve Domain Alias
- WordPress Rewrites – How can I pass a variable to Custom Post Type?
- Rewrite rules automatically for pages using specific template
- Custom Rewrite rule to captured post (rewrite rule to rewrite rule)
- Rewrites: .htaccess or wp_rewrite for bulk 301 changes?
- RSS feed rewrite matching wrong rule
- Replace “http://localhost:8888/” by website URL in WordPress
- Bulk append URL (add word to slug)
- Thousands of 404 errors on old posts due to embedded links
- WP Rewrite for a custom variable
- How can I allow trailing slashes on some URLs without a redirect, but not on others?
- How do I get posts to appear at mydomain.com/blog?
- rewrite rules and capturing
- Redirect to new domain that serves new and different content
- How to redirect to a login virtual page?
- Help adding custom url, rewrite_rules_array
- Implementing geotargeting while using a single database
- Slug collision between page, taxonomy and custom post type
- Two CPT: one is using part of the custom rewrite slug from the other
- Get custom posts by segment of the URL
- Add ReWrite from Old Pages to WordPress (remove .php)
- Remove trailing slash
- Rewrite Url to a SEO-friendly format
- Use Parent Pages for URL Structure without Landing Page
- rewrite rule of post when accessed from archives pages
- Redirect A URL Pattern In WordPress Using .htaccess
- Rewrite Question
- Change the search URL
- How to make a custom route with any-string-part/number-part pointing to an existing page?
- username in rewritten URL, howto use it in a template
- Rewwrite rule for mapping plugin static file
- wordpress url rewrite Query Var to Static url
- Add rewrite endpoint and .htaccess
- Remove url parameter using wordpress
- How to make custom WordPress page deliver search results
- URI rewriting: handling one page
- Problems Implementing Non-WordPress Rewrite Rules