Add a Sub Folder to Uploads in Wp

In this commodity, nosotros wait at the benefits and limitations of installing WordPress in a subdirectory, how to install and manage subdirectory installs, and how to movement WordPress cadre out of and into a subdirectory for an existing site.

I of the common criticisms PHP developers level at WordPress is that it installs all its core files straight in the web root directory. Modernistic PHP frameworks like Laravel install their required files as separate dependencies in a vendor directory, each residing in its own specific subdirectory. Not only that, but unlike WordPress, Laravel keeps almost all the PHP files out of a publicly accessible directory, which is very overnice for security. This makes for a cleaner, more secure binder structure in the awarding's spider web root.

These modern PHP awarding directory structures make a default WordPress install wait decidedly unprofessional. While it's non possible to move all the PHP files out of the public spider web root in a WordPress install, you can customize your installation to mimic this dependency-based development concept by installing WordPress in a subdirectory.

Table of Contents

  1. The Benefits of Installing WordPress Cadre in a Subdirectory
  2. How to Tell if WordPress Core is Installed in a Subdirectory
  3. How to Install WordPress Cadre in a Subdirectory
    1. The Official WordPress Documented Methods
    2. Manually Configure a Subdirectory Install
    3. Using WP-CLI to Install WordPress in a Subdirectory
    4. Using Composer to Install WordPress in a Subdirectory
  4. Considering the WordPress File and Binder Structure
    1. Moving the WordPress Config File
    2. Moving the WordPress Content Binder
  5. Converting a Root Install to a Subdirectory Install
    1. Prepare Your Site
    2. Update the Database
    3. Moving WordPress Files Into the Subdirectory
  6. Converting a Subdirectory Install to a Root Install
    1. Ready Your Site
    2. Update the WordPress Database
    3. Moving WordPress Out of the Subdirectory
  7. Wrapping Upward

The Benefits of Installing WordPress Core in a Subdirectory

In most web hosting environments, your account is provisioned under a /home/username binder where username is your account username. This folder is sometimes called the elevation-level or root of your account, and the actual path varies from spider web host to web host. You volition typically accept a public or public_html binder configured to serve the website files. This is generally known every bit the web root directory, and information technology'southward where WordPress is usually installed.

The directly do good of moving WordPress core files into a subdirectory is a cleaner and more professional-looking directory structure in your web root. Some folks think that switching to a subdirectory install improves security through obscurity. This is only really applicable if you move your wp-config.php file outside of the publicly accessible web root directory, whether you use a subdirectory install or not.

Nonetheless, in the mod earth of automated scanning bots, moving your WordPress core files to a subdirectory might help decrease the chances of malicious bots detecting vulnerabilities when scanning your site. For example, in a typical WordPress install, all your core files are in the public web root, which is accessible from your apex domain (due east.thou., https://hellfish.media). So all a scanner needs to practise is browse your domain name, check for a mutual WordPress file similar https://hellfish.media/wp-blog-header.php, and it will know you have a WordPress install. If you move the core files to a subdirectory, it makes it harder (just not impossible) for attackers to identify that you're running WordPress.

A cleaner directory construction and an increase in security are sound reasons to motility an install into a subdirectory, just at that place are some things you'll need to know to accomplish this. You won't be able to just move the WordPress install to a subdirectory and expect everything to work.

How to Tell if WordPress Cadre is Installed in a Subdirectory

With a WordPress install yous've completed yourself, you'll probable know if it'due south installed in the web root (i.due east., a root install) or a subdirectory. However, you might exist in a situation where y'all inherit a site, or use a hosting provider's 1-click installer, or it's been a really long time since the initial setup.

To determine if your WordPress install is in the spider web root or a subdirectory, head to your WordPress dashboard and navigate to the Settings > General screen. At that place you lot volition run across the "WordPress Address (URL)" setting and "Site Address (URL)" settings:

Standard WordPress install settings.

If the values match, you lot have a root WordPress install. If the "WordPress Address (URL)" has an boosted path compared to the Site Address (URL), it's in a subdirectory. You tin also tell past looking at the URL when you log into your site. If WordPress was installed in a subdirectory, so the wp-admin page will be shown under that subdirectory (such equally hellfish.media/wp/wp-admin/).

How to Install WordPress Core in a Subdirectory

There are a few dissimilar means you can install the WordPress core files in a subdirectory.

The Official WordPress Documented Methods

The methods to movement WordPress into a subdirectory are detailed in the WordPress.org support documentation. These options are available to you lot afterward you've already installed WordPress.

The two options are:

  1. Moving a WordPress install to its own directory, without changing the site URL
  2. Moving a WordPress install to its own directory, with a change to the site URL

Neither of these options really assist with the increase in security we discussed before. The commencement option moves the site files to a subdirectory and uses rewrite rules in a custom .htaccess file to rewrite requests to the subdirectory. Any bots scanning your URL will even so be able to make up one's mind that it'due south using WordPress.

The 2d option is even less related to security, and more than useful if y'all accept a custom site setup. This is often used where y'all want to employ WordPress to ability a web log at a subdirectory of your URL (east.g., https://hellfish.media/blog) and yous'll use something else to ability your pinnacle-level URL.

That being said, both methods movement your WordPress install to a subdirectory, so your web root at least looks tidier.

What would be nice is that first pick, only without any URL rewriting for better security.

Manually Configure a Subdirectory Install

If you recall the earlier description of how the files in a WordPress installation "require" each other, you lot might have also noticed that in the wp-blog-header.php file, the ABSPATH constant is divers. This constant points to the location where the WordPress core files are installed, no thing where that might exist on the file organisation.

This means that with a little bit of knowledge and some tinkering, we tin can motility all the WordPress core files into a subdirectory, and make a few small changes to permit WordPress know where everything is. The process looks like this:

  1. Follow the default WordPress install process.
  2. Once WordPress is installed, create a subdirectory and move all the files from the web root to that subdirectory. To help with "hiding" the core files, you should requite the subdirectory an uncommon proper name, just for our example, we'll create a subdirectory chosen wp, and move all the files to the wp subdirectory.
  3. Then, copy (not move) the index.php file from the subdirectory dorsum into the web root directory.
  4. In that newly copied file, update the line that requires the wp-weblog-header.php file, to point to the new subdirectory, and save that file: require __DIR__ . '/wp/wp-blog-header.php';
  5. The last step is to update the siteurl value in your WordPress options table—
    using something similar the SQL Buddy plugin or phpMyAdmin—to point to the new subdirectory install, for case, https://hellfish.media/wp.

Yous'll note we said "copy (not motion)" in pace iii. This is important considering WordPress needs an index.php file in the install directory (in this case the subdirectory), or it volition cause PHP warnings to display on your site or fill upwardly your debug.log file.

Once you've completed these steps and all your cadre WordPress files are in a subdirectory, you will still be able to browse to the front of your site at your top-level domain (east.g., https://hellfish.media/), but to access your Dashboard you'll need to browse to wp-admin in the subdirectory (e.g., https://hellfish.media/wp/wp-admin). Y'all might be concerned nigh losing the changes you've made to the re-create of the index.php file the side by side fourth dimension WordPress is updated. Even so, WordPress will only update cadre files in the installation directory, in this example, the subdirectory. So it's perfectly adequate to edit the index.php file you copied to the web root directory. Your web root is a fiddling tidier, and it's a bit harder to determine yous're running WordPress.

While this gives y'all a small increase in security, we'll dive into other changes later on to further improve security.

Using WP-CLI to Install WordPress in a Subdirectory

Yous're probably going to want to automate the higher up process if you are managing your own WordPress installs or you have your own VPS servers. Fortunately, this is possible with a piffling Fustigate scripting and WP-CLI. The following script leverages WP-CLI to create a new WordPress site installation with the core files in a specific subdirectory, essentially reproducing everything we did above. It besides assumes you don't already have the database created, and creates information technology for you lot. The process will still work if yous accept an existing database, but will display a MySQL mistake message that the database already exists.

          #!/bin/fustigate  # Installation:  ## Download the script to your dwelling directory # Brand sure it has execute permissions (`chmod +x wp-install-core-sub-dir.sh`). # Install the script in ane of the folders in your PATH. (`mv wp-install-core-sub-dir.sh /usr/local/bin/wp-install-core-sub-dir`)  #Usage:  # $ mkdir mysite # $ cd mysite # $ wp-install-core-sub-dir {sub-directory} {db_name} {db_user} {db_pass} {site_url} "{site_title}" {admin_user} {admin_pass} {admin_email}  CORE_DIR=${1-'wp'} DB_NAME=${2-'wordpress'} DB_USER=${3-'root'} DB_PASS=${4-'password'}  SITE_URL=${5-'https://wordpress.test'} SITE_TITLE=${half dozen-'WordPress Site in a Subdirectory'} SITE_USER=${7-'admin'} SITE_PASS=${8-'password'} SITE_EMAIL=${ix-'your@email.com'}  # create the dir for the core files mkdir $CORE_DIR cd $CORE_DIR  # download WordPress files wp core download  # create the wp-config.php file wp config create --dbname=$DB_NAME --dbuser=$DB_USER --dbpass=$DB_PASS  # create the database wp db create  # install WordPress (less than 5 mins) wp core install --url=$SITE_URL --title="$SITE_TITLE" --admin_user=$SITE_USER --admin_password=$SITE_PASS --admin_email=$SITE_EMAIL  # Re-create (non motility) index.php file to root cd ../ cp "$CORE_DIR/index.php" ./index.php  # Edit index.php to point to correct path of wp-web log-header.php perl -p -i -e "s/\/wp-blog-header/\/$CORE_DIR\/wp-blog-header/g" index.php   # Update the siteurl in the database with sub directory path cd $CORE_DIR wp choice update siteurl $(wp choice become siteurl)/$CORE_DIR  # Uncomment the below line if you want the config in root #cp "$CORE_DIR/wp-config.php" ./wp-config.php  echo 'Install finished!'                  

Y'all tin can too view this script on Github.

Using Composer to Install WordPress in a Subdirectory

A popular way to manage WordPress projects is to use Git for source control, and Composer to install WordPress core, the theme, and whatsoever plugins as dependencies in the composer.json file of your project.

When y'all're fix to deploy your site, y'all trigger an automatic deployment procedure, which runs composer install to install all your required dependencies.

If y'all use the johnpbloch/wordpress parcel, it will install the wordpress-core bundle in a subdirectory called wordpress by default. Yous can change this by supplying a custom wordpress-install-dir directory in the extra section of your composer.json. You tin can then make use of the Composer mail service-install-cmd event to run the necessary subdirectory changes you lot demand.

          {     "name": "polevaultweb/wp-composer-core-sub-dir",     "description": "Installing WordPress in a subdirectory with Composer",     "require": {         "johnpbloch/wordpress": "^5.viii"     },     "extra": {         "wordpress-install-dir": "wp"     },     "scripts": {         "post-install-cmd": [             "cp wp/index.php ./index.php",             "sed -i \"s/\\/wp-blog-header/\\/wp\\/wp-blog-header/g\" index.php"         ]     } }                  

As you can see, this replicates the subdirectory process we've already outlined earlier. One time the composer install has been completed, WordPress will be installed in the wp subdirectory, the index.php file will be copied to the web root, and edited to update the path to wp-blog-header.php

It is worth noting that the post-install-cmd event only fires later the install control has been executed with a lock file present. Information technology won't trigger the subdirectory the first time you run composer install locally, as the lock file is only generated after the first time composer install is run.

Unlike the Fustigate script in a higher place, this does not create the wp-config.php file or run the WordPress installation to create the database tables. Y'all tin do these manually in your browser, using WP-CLI commands in the mail service-install-cmd effect, or using post deploy scripts if your hosting provider supports them.

Considering the WordPress File and Folder Structure

As mentioned earlier, moving the core files to a subdirectory allows for a small-scale security improvement, but it's notwithstanding possible to make up one's mind if your site is running WordPress. This might exist a good time to think about any other changes we could make to improve our directory construction and increase security.

Our recommendation is to configure your top-level or root directory structure to look something like this:

                      /home/username/     conf/       wp-config.php     public/       content/       wp/       index.php       wp-config.php                  

Nosotros've already shown you lot how to move the WordPress core files into a subdirectory (in this case wp) so let'due south come across what else we can change, and why.

Moving the WordPress Config File

The wp-config.php file contains your database credentials, and oft any other important API or third-party access keys, simply did yous know that information technology'south possible to motion this file to a unlike location from the balance of your WordPress core files?

Woah.

Moving this file to somewhere other than the web root or the subdirectory install is generally considered a much safer selection. The reason for this is that in some cases, issues with the web server could cause it to stop processing PHP files correctly. Common causes for this include a lack of bachelor memory, or a web server misconfiguration. Any the crusade, if this happens, visitors to the site might exist able to view the contents of PHP files including the database credentials in your wp-config.php file.
In fact, many would argue that it should be placed even higher upwards in the directory tree than the root directory.

To achieve this, you would move the wp-config.php file to a unlike location on the server (in our case nosotros'll motility it to the conf directory simply higher up the public web root directory) and either comment out or delete all the lawmaking later the following line:

          /* That'due south all, stop editing! Happy publishing. */                  

We and then create a new wp-config.php file in the public web root, with the following code:

          <?php require_once __DIR__ . '/../conf/wp-config.php';  /** Sets up WordPress vars and included files. */ require_once ABSPATH . 'wp-settings.php';                  

WordPress will automatically wait for the wp-config.php in the parent folder to where the core files are. Past creating our custom wp-config.php file in the web root, we keep the wp folder that contains the cadre files clean of any custom files. The "true" wp-config.php file is moved to a location that'due south not publicly attainable, but where WordPress can yet crave it, and your database (and other) credentials are safer.

Moving the WordPress Content Binder

With our WordPress core files in a subdirectory, we could consider moving the wp-content directory too. Themes, plugins, and file uploads should (in virtually cases) exist divide from the core files. This is especially useful if yous use version control software similar Git to manage your project source code.

WordPress allows us to accomplish this, by setting some WordPress-specific constants, in the wp-config.php file in our wp subdirectory.

          define( 'WP_CONTENT_DIR', dirname( dirname(__FILE__) ) . '/content' ); ascertain( 'WP_CONTENT_URL', 'https://' . $_SERVER['HTTP_HOST'] . '/content' );                  

This configuration tells WordPress to expect to detect the content directory in a directory called content in the web root. It's inspired by Mark Jaquith's WordPress skeleton, with small-scale tweaks to friction match our directory structure. Equally Mark points out in the GitHub readme, it'south cleaner and the content directory is no longer in the scope of the wp directory.

If yous make this modify on an already existing site, you will need to move the contents of your wp-content directory (plugins, themes, uploads, etc.) to the new content directory. Y'all will too need to run a Find & Replace on all your data. The goal is to update URLs for your media and asset files to point them to the new content URL, likewise as ensuring any saved file paths are now pointing to the new content path.

If any external sites are linking to whatsoever of your media or assets, y'all'll desire to prepare a path redirect, so that those links don't throw 404 errors. This can be achieved by setting a path redirect using regex with a matching cord of ^/wp-content/(.*) and setting the redirecting string to /content/$1. Nosotros recommend setting up this redirect at the web server level for best performance. If using SpinupWP, this can exist done via the Path Redirects screen:

Setting up a path redirect on SpinupWP.

If you're unable to fix a redirect at the spider web server level, the Redirection plugin is the next best thing.

Converting a Root Install to a Subdirectory Install

Installing the WordPress cadre files when starting a new site is straightforward enough, but converting an existing root install to a subdirectory install requires some care. It'due south non just a instance of creating a subdirectory in your web root and moving all the WordPress files there. You lot also demand to take into account whatsoever URLs or paths stored in the database that points to your root install directory. Nosotros comprehend the details of this in our WordPress Core Installed in a Subdirectory help doc, just let's look at a simple example.

I've fix up a local site, https://hellfishmedia.test, as a WordPress root install.

Root directory install.

I've also created a very bones page to serve as the site dwelling house page, which includes an epitome in the page content, and a link to a Contact page.

Hellfish Media Home Page.

Step 1: Prepare Your Site

If this is a live site, information technology's a skillful idea to show a maintenance message while you make changes that could break the site. For this, we recommend the WP Maintenance Style plugin. Install it, activate maintenance mode in the plugin settings, and your users will see a bulletin letting them know about the cursory period of downtime.

Maintenance message.

Front-finish users will only see the maintenance page, but we can however access the WordPress dashboard through https://hellfishmedia.test/wp-admin/.

Step two: Update the Database

For our example, we'll exist moving WordPress into a new /wp subdirectory, then you lot need to update the database to reverberate that modify – merely only for URLs that need it.

Y'all only demand to worry virtually references to prototype files and avails independent in theme or plugin folders. All of those are located under /wp-content past default, or a custom content path, if you lot've configured one. As such, y'all tin can utilise the content path to target URLs and file paths you demand to alter. If you've configured a different location for your content as we described earlier, you might need to tweak this to friction match.

This is possible using whatever decent notice and replace tool, including the WP-CLI search-replace control, Improve Search Supercede, or WP Drift DB. For our purposes we'll be using WP Migrate DB Pro's Observe & Replace tool.

In our case site, we'll desire to find //hellfishmedia.test/wp-content and supersede it with //hellfishmedia.test/wp/wp-content, and discover /home/iain/development/websites/hellfishmedia/wp-content and supplant it with /home/iain/development/websites/hellfishmedia/wp/wp-content to update URLs and file paths respectively. For the sake of the test, nosotros're too replacing the site championship. Here'south what this volition look similar in WP Drift DB Pro:

Custom find & replace with the specified changes.

What's keen about the WP Migrate DB Pro Find & Supersede tool is that yous can preview the changes before y'all run them.

Custom find & replace preview.

You lot tin can also inspect what updates the plugin will make on a per-table basis.

One time you run the find and replace, and take a look at any page content, you'll see that while links to the Contact page don't include the subdirectory, the embedded image does:

Showing the updated content URLs in the code editor.

Your next stride is to update the "WordPress Address (URL)" setting in your "General Settings" page to include the subdirectory. You lot can practice this by navigating to Settings > General in your WordPress admin, and adding the subdirectory to the "WordPress Address (URL)" field. This will intermission the backend of your site until you complete the balance of this procedure, then make sure you don't need to access it for a chip.

Updating WordPress address.

In one case y'all save the change, your WordPress admin dashboard will prove y'all a "Page not found" error and your maintenance page will lose all its styling. This happens because WordPress is still looking for all its admin and asset files nether https://hellfishmedia.test/wp/, but they don't exist.

Stride three: Moving WordPress Files Into the Subdirectory

While the maintenance page won't wait pretty at this indicate, at to the lowest degree it displays the maintenance bulletin to your site users. Unfortunately, that's going to break in the adjacent step, equally you need to movement the files from the web root into the correct subdirectory. For our case, we'll do the following:

  1. Create the wp subdirectory in the web root.
  2. Move everything from the web root into the wp directory.
  3. Copy (not movement) the alphabetize.php file and the .htaccess file from /wp back into the spider web root directory.

You tin can do this via your local file manager, or via an FTP client if information technology'south a remote server.

Alternatively, if you lot prefer the terminal, the commands would expect like this:

          cd ~/development/websites/hellfishmedia mkdir wp mv * .* wp/ cp wp/index.php . cp wp/.htaccess .                  

This will crusade the maintenance page to brandish an error.

          Alarm: require(/home/iain/development/websites/hellfishmedia/wp-web log-header.php): Failed to open up stream: No such file or directory in /dwelling house/iain/evolution/websites/hellfishmedia/index.php on line 17  Fatal error: Uncaught Error: Failed opening required '/home/iain/development/websites/hellfishmedia/wp-blog-header.php' (include_path='.:/usr/share/php') in /dwelling house/iain/development/websites/hellfishmedia/alphabetize.php:17 Stack trace: #0 {main} thrown in /habitation/iain/development/websites/hellfishmedia/index.php on line 17                  

The terminal step is to update the require expression in the alphabetize.php file in the web root with the path to the new subdirectory, as we showed you right at the start of this guide. Edit the file in your code editor, and update the line to look like this:

          require __DIR__ . '/wp/wp-blog-header.php';                  

Alternatively, if you prefer to run a terminal command, you tin can utilize the same perl command that our WP-CLI script used earlier:

          perl -p -i -e "s/\/wp-blog-header/\/wp\/wp-blog-header/k" alphabetize.php                  

Your root install should at present be fully converted to a subdirectory install. You lot should take this opportunity to check all your content, make sure everything appears to be working, and that images display as yous'd expect.

It's also a skillful idea to log into your dashboard and navigate to Settings > Permalinks to save and flush your permalinks.

Ane concluding thing to note is that the example site nosotros set upward here doesn't have a lot of plugins or a custom theme. These aspects could add together boosted complexities when converting betwixt root and subdirectory installs. For this reason, nosotros recommend making sure you've thoroughly tested the site later converting information technology from one install type to another.

Converting a Subdirectory Install to a Root Install

If you've completely converted to running all your WordPress sites as subdirectory installs, you might come beyond a situation where you need to work with a alive customer site that is a root install. If you use a tool like WP Migrate DB Pro, it's not possible to drift from a subdirectory install to a root install. This means you might need to first convert a local dev or staging site to a root install before migrating it to the live site. Converting a subdirectory install to a root install is near ever easier than the reverse because the URLs and paths are already using the subdirectory path you're converting from. To do this, yous'll need to update both the database and the file structure, ideally with a minimal amount of downtime.

I've ready a local site, https://hellfishmedia.test, with WordPress installed in a subdirectory named wp.

WordPress subdirectory install.

I've besides created a very basic page to serve as the site home page, which includes an image in the page content, and a link to a Contact page.

Hellfish Media Home Page.

Step i: Set up Your Site

Converting the site is going to require some database changes but before you exercise this you lot'll want to ensure that you can still admission wp-admin. To achieve this, ascertain the site URL and home URL values in the wp-config.php file. This volition override the settings for siteurl and dwelling house in the wp_options tabular array and will foreclose you from losing admission to the WordPress dashboard.

          // The URL where the WordPress application files are accessible define( 'WP_SITEURL', 'https://hellfishmedia.test/wp' ); // URL where the front finish is accessible define( 'WP_HOME', 'https://hellfishmedia.examination' );                  

If the subdirectory site is live, information technology would be a skillful idea to show a maintenance bulletin while y'all brand changes that could suspension the site. For this, we recommend the WP Maintenance Mode plugin. Install it, activate maintenance mode in the plugin settings, and your users volition meet a message to let them know about a brief menstruation of downtime, rather than a cleaved site.

Maintenance message.

However, we can however visit the dashboard using https://hellfishmedia.exam/wp/wp-admin/.

The next step is to update the database.

Step 2: Update the WordPress Database

At present you lot can update the database to remove any references to the subdirectory. This is possible using any decent find and replace tool, including the WP-CLI search-supervene upon command, Improve Search Replace, or WP Migrate DB. For our purposes, we'll be using the WP Migrate DB Pro Observe & Replace tool.

To commencement, nosotros search for the source site URL, including the subdirectory (//hellfishmedia.test/wp) and replace information technology with the URL excluding the subdirectory (//hellfishmedia.exam). We also want to update any physical paths from /home/iain/development/websites/hellfishmedia/wp to /home/iain/development/websites/hellfishmedia. We're too updating the site championship for demonstration purposes:

Custom find & replace with the specified changes.

As nosotros mentioned before, WP Migrate DB Pro's Find & Supersede tool lets y'all preview changes before y'all run them.

Find & replace preview.

Yous tin even inspect what updates the plugin will make on a per-table footing. Here I tin confirm that the link to the image in the wp_posts tabular array for my Home folio will be updated, every bit well as the GUID for the paradigm attachment. If I don't want to update the GUID, I could alter this in the settings. In this case, it makes sense to change the GUID.

Find & replace differences.

You might non notice whatsoever changes afterward you run the find and replace. The front end will still show the maintenance page, while the dorsum stop will still work because of the hardcoded constants.

However, if you look at some post content, you'll notice that the images are cleaved and internal links now lack the subdirectory. Hither is the dwelling house folio in the Cake Editor:

Editing the home page.

To prepare this, in that location's one last step we have to do.

Step 3: Moving WordPress Out of the Subdirectory

Your concluding stride is to manually move all the files in the subdirectory into the public web root directory of your site.

You drag and drib the files in your local file managing director or use an FTP client if you're working on a remote server. All the same, be sure to select the selection to overwrite the index.php file:

Moving the files in the file manager.

Once you've copied over the files, you tin can delete the wp subdirectory.

You lot can also do this on the control line, but if your site is on a remote server yous need to SSH into the server commencement. In this example, I'yard working with my local hellfishmedia directory that we ran the find and replace on earlier.

          cd ~/evolution/websites/hellfishmedia rm index.php cp -R wp/. . rm -rf wp                  

The last piece is to remove the WP_SITEURL and WP_HOME constants from your wp-config.php and so test your site.

Information technology'southward also a good idea to log into your WordPress dashboard and navigate to Settings > Permalinks. Hither, click the Save Changes button to make sure you flush the permalinks and that your URLs however work.

Wrapping Upwards

Hopefully, we've given y'all plenty information to consider switching your root installs to subdirectory installs, equally well every bit the tools to practise so. If you're looking for a modern, Composer-based option, you could consider using a similar structure as our SpinupWP spinupwp-composer-site parcel, which takes the idea of installing WordPress as a dependency to a whole new level.

Do yous run your WordPress installs in a subdirectory? What workflows exercise y'all utilize to manage your WordPress directory structure? Exercise y'all call back WP Drift DB Pro should do more than to make the migration process between the root and subdirectory more straightforward? Allow the states know your thoughts in the comments section below!

blackariervintend01.blogspot.com

Source: https://deliciousbrains.com/move-wordpress-root-subdirectory/

0 Response to "Add a Sub Folder to Uploads in Wp"

Enviar um comentário

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel