WordPress has a built-in setting for this that can be set in the Settings > Permalinks screen.
Choose “Custom Structure” and add in your desired prefix/subdirectory at the start of that input field with a slash after it.
/subdirectory/%postname%
Related Posts:
- How would you detect if WordPress is installed in a subdirectory (not root)?
- Second wordpress installation on subdirectory
- Subdomain redirects to subdirectory [closed]
- After changing wp from subdirectory to root I can’t preview any changes to a page or post
- Should I install blog on subdomain or subdirectory?
- wordpress sub-directory sites on a sub-domain?
- Trying to setup a dev subdomain, but url loads as /dev/ instead
- WordPress page for one specific page on Google Cloud hosted website?
- How to Install WP to Subdomain but Serve on Subdirectory?
- Compare 2 directories in windows
- get_template_directory() vs bloginfo( ‘template_directory’ ) vs TEMPLATEPATH
- Change upload directory for PDF files
- What’s the purpose of index.php in wp-content directory? [duplicate]
- How do I serve static content on same domain as WordPress
- Multisite: differences between subdomain and subdirectory mode? Can it be switch after installation?
- Can I change get_template_directory_uri()?
- NGinx + WordPress Subdomain Multi with core in Subdirectory
- Site redirects to wrong url when saving settings
- Multisite installation combining subdomains and subdirectories
- Custom Post Type Archive in Sub Folder
- How to point my domain to a WordPress install in a sub-directory?
- Can I put my WordPress theme files in another folder?
- Multiple domains for multiple single installs
- How to Create Hierarchical Directory for Nation Wide Mental Health Services
- Sub-domain or 2nd, temporary different domain?
- How do I set up single sign on for multiple WP installs across the same domain?
- Why doesn’t WP_PLUGIN_DIR definition use DIRECTORY_SEPARATOR?
- How to copy one folder to another folder recursively
- Disable to create folders for every years and months in uploads folder
- local folder permissions vs chown — security considerations
- How is a student directory best handled in WordPress?
- Creating directory in uploads: mkdir vs wp_mkdir_p
- On WordPress Network(multisite), Sub Blogs in Subdirectories or Subdomains? What’s better?
- Two identical wp-includes directories on server
- What is the recommend directory in which I can upload a new library?
- Install theme on multiple domains
- Change multi-site installation from sub-domains to sub-directories
- how to create a folder in wordpress
- Accessing WordPress installation in its own directory at domain root
- Right permissions to WordPress directory
- more than one upload directory?
- Mapping Subdomains in WordPress to give the appearance of a localised site, best approach?
- 2 WordPress sites in 2 sibling folders on one domain
- Main WP page and subfolder WP with the same name. How to prioritize for main Wp
- Auto-create a post with last 10 images in WordPress directory
- Copy Folder to another Folder using WP Filesystem
- Unable to update WordPress or install plugins/themes
- One Domain, Two Installs of WordPress
- Two WordPress installations: One in root and one in sub directory – no images in subdir installation [closed]
- Moved WordPress site to new server, directory permissions not working correctly
- Moving from one test to multiple final environments
- WordPress in a sub directory but not images
- Hiding Directory Path
- Moving WP from /blog to root directory
- Should custom directories be created under the wp-content directory?
- Use of Folders within WordPress
- Hosting my WordPress site out of a subdirectory
- Theme file structure best practice
- Subdomain to website directory blog transferring
- Path in dev server works; same path in prod server is broken
- What is wp-admin/meta for?
- google xml sitemap won’t work on directory install
- What plugins create a directory on the root directory of WordPress? [closed]
- Access sub-domain when root public_html is protected with .htaccess password
- Automating WP application directory creation (domain name passed as a variable argument)
- How to disable directory files from accessing?
- Wp-CLI not working with WordPress installed with composer
- How to visit php file in my custom directory under site root directory
- Does WordPress refer to any files outside of the main install folder (and database)?
- WordPress File Structure
- Getting Internal server in sub folder pages
- Impossible to index an upload folder with 10k files
- Multisite for main in subdirectory, subdomain and subfolders (EN/ES)
- Moving from subdirectory and subdomain -> root
- Best way to transfer WordPress install to root of directory when I’m ready to launch?
- How to redirect template_directory to subdomain relativ url?
- How to move a WordPress installation to a subdirectory
- multisite installed on subdomain now want another subsite on subdirectory
- WordPress hosted on subfolder of domain causing customizer to constantly refresh and is requesting jquery from root domain
- WordPress Bedrock breaking plugin links
- How to Best Create Separate Subscribers and User Experience
- How to install WordPress on sub directory in ubuntu 16.4 in same vhost with AngularJS
- Bedrock WordPress retro-porting to standard WP installation: is this allowed?
- Change the WordPress files structure
- Problems with running a 2nd installation of WordPress on my domain?
- Downloadable content file structure
- WordPress makes 404 error when going to domain folder
- Using same root header in subfolder wp blog – Header disapears on Single Posts
- Run multiple installs using the same wp-admin & wp-includes?
- How do I get WP site to show in both root and sub-directory
- How to replace a wordpress installation in root directory with another in a subdirectory?
- Multisite, different domains, optional subdirectory, and htaccess
- Move WordPress with changed name ‘wp-content’
- FTPS Uploads – wp-content cannot be found
- Index (Home) page not displayed when running wordpress in a subdirectory
- Hide/Remove Wp Directory /wp-content/uploads/
- The right way to go about creating a WordPress site from a static site which has WordPress installs in its subdirectory
- Multi site root site installed on subdomain, with child sites as subdirectories
- Multisite Sub-directories Installation
- Could moving my WordPress installation from /var/www/html/ to /var/www/ break the application?