As you may already be aware, WordPress websites running on the same server each require separate plugin and theme installations. It makes sense, but does come with some drawbacks, especially if your sites use similar plugins and themes. Updating each site individually in this instance can become a βtimesinkβ, not to mention the potential impact on your storage.
If you want to share the same plugins and themes among websites, thereβs a neat trick you can use called a βsymlinkβ. In this article, weβll talk more about what symlinks are and the ways you can use them in WordPress. Then weβll teach you how to implement a symlink in three steps.
Letβs get to it!
An Introduction to Symlinks
Symbolic links β or symlinks β can be considered shortcuts on steroids. Some applications require you to store data in specific directories so they can access it. Using symlinks, you can fool those apps into thinking the files itβs looking for are there, while you store them somewhere else.
Take Dropbox or Google Drive, for example. Both apps require you to place the files you want to backup within specific directories. Using symlinks, you can connect external folders to those directories, but still have Dropbox or Google Drive act as if they were located inside.
In practice, there are two types of symlinks. You have βsoftβ symlinks, which act like run-of-the-mill shortcuts, and βhardβ symlinks (this βtricksβ apps requiring files and folders to be within specific directories, as per our example). Our focus in this article is going to be on hard symlinks, so letβs talk about how you can use them in WordPress.
Why Youβd Want to Use Symlinks in WordPress
The main benefit of using symlinks is that you can store files anywhere you want, even if they need to be in a specific location to work. All you have to do is install a symlink between two directories, and your Operating System (OS) will treat them the same.
When it comes to WordPress, this is useful in a variety of ways:
- You can link several sites to the same plugins and themes.Β With symlinks, you can use the same plugin and theme files for multiple sites, as long as theyβre all on the same server.
- Theyβre perfect for testing environments.Β If youβre developing a theme or a plugin and you want to test it using several websites, symlinks enable you to do it without having to change each installation.
- You can save on server space.Β To be fair, plugins and themes often donβt take up much room, but extra space is always good.
Symlinks, while very cool, are mostly useful for WordPress development purposes. If youβre running a live website, thereβs little reason to use them, even if youβre hosting more than one installation on the same server. The reason is since youβre sharing the same files among multiple websites, you canβt set up unique plugin and theme configurations for each site. Itβs perfect for a development environment, but it can create a lot of headaches in real-life scenarios.
Finally, itβs also worth mentioning youβll need full server access to set up symlinks in WordPress. This is because you need to use the command line to create a symlink, which weβll discuss in the next section.
How to Implement Symlinks in WordPress (In 3 Steps)
For this tutorial, weβre going to include commands that work on both Windows and UNIX-based systems. The commands themselves are rather simple in either case, so donβt worry.
Step #1: Move Your Plugins or Themes Folders Using File Transfer Protocol (FTP)
Usually, WordPress stores your plugins and themes within theΒ wp-contentΒ directory, which is inside your WordPressΒ rootΒ folder. Once you openΒ wp-content, youβll find two folders calledΒ pluginsΒ and themes, among others:
By default, WordPress usually sets up a unique folder for each plugin or theme you install. For example, hereβs the folder for the Divi theme we set up on our test site:
Within the folder, youβll find all of the files powering the theme. If you move the folder elsewhere, WordPress wonβt be able to find it, and it wonβt display the theme among your installed options. What weβre going to do now is move the folder to a new location using the command line. Our current path is var/www/html/wp-content/themes/Divi, butΒ letβs say we want to move theΒ DiviΒ folder to our serverβsΒ rootΒ directory, while creating a new folder to store it (i.e. wp-themes/Divi).
Technically, you can move your plugin or theme folders to any location on your server. Furthermore, your server might not share the same structure, depending on your OS. In any case, go ahead and access your website via FTP. If you need a client, we recommend using FileZilla.
Once youβre in, find the folder you want to move, which in our case, isΒ Divi. There should be a section of FileZilla that shows your current location:
Simply find the directory youβd like to move theΒ DiviΒ folder to and drag it into place (i.e. into the bottom quadrant):
Wait until FileZilla moves all of the files within the folder and youβre good to go. If you access WordPress now, you wonβt see Divi within theΒ ThemesΒ tab. To restore it, youβll need to create a symlink, which will require you to use the command line.
Step #2: Access Your Serverβs Command Line Via Secure Shell (SSH)

SSH enables you to connect to your server and use its command line.
If youβre using a local development environment, open your command line, and move on to step number three. However, if youβre trying to create a symlink for a remote server, youβll need to connect to it via Secure Shell Access (SSH).
SSH is a protocol similar to FTP in that it enables you to connect to your website. However, unlike FTP, SSH provides you with more control over what you can do. More importantly, it enables you to use your serverβs command line.
Rather than run through the steps again here, we encourage you to take a look at a previous post, in which youβll find step-by-step instructions to connect to your site via SSH. The process shouldnβt take you more than a few minutes, so check it out and come back once you establish a connection.
Step #3: Create a Symlink and Test It
You only need use a single command to set up your symlink, although it varies depending on the operating system youβre using. If youβre on a Linux server, youβll need to navigate to yourΒ wp-contentΒ directory and open theΒ themesΒ folder. There shouldnβt be aΒ DiviΒ folder inside anymore since we moved it earlier. Once youβre inside the directory, typeΒ ln -s Β /wp-themes/Divi DiviΒ into the Command Line Interface (CLI).
This command simply links theΒ wp-themes/DiviΒ directory we set up in step number one to a new folder calledΒ Divi, insideΒ wp-content. All of the themeβs files will remain in the former location, but WordPress will act as if they were insideΒ wp-content. If youβre on a Window server, on the other hand, the command changes (mklink C:/yourthemesnewlocation my-theme), but its structure remains the same.
You always need to specify the location of the folder youβre linking to first. Then, you create a new symlinked folder in the second part of the command, regardless of whether youβre using Linux or Windows.
To test your new symlink, open your WordPress website and take a look at theΒ ThemesΒ tab:
If WordPress doesnβt recognize the plugin or theme you moved, thereβs probably an error with your symlink command. In most cases, itβll be because you werenβt located within theΒ wp-content/pluginsΒ orΒ themesΒ directory when you used it, which means your new symlink folder was set up elsewhere.
Conclusion
Symlinks enable you to use WordPress plugins and themes without storing them in yourΒ wp-contentΒ folder. You can take advantage of them in several scenarios, such as for testing custom plugins. Theyβre also ideal if youβre hosting several websites on the same server and you want to share resources among them.
Setting up symlinks isnβt complicated, but youβll need access to your serverβs command line. Hereβs how to do it from the beginning:
- Move your plugin or theme folders using FTP.
- Access your serverβs command line via SSH.
- Create a symlink and test it.
Do you have any questions about how to use symlinks in WordPress? Letβs talk about them in the comments section below!
Article image thumbnail by Dmitry Guzhanin / shutterstock.com.
Great idea…but will this cause problems with insecure content errors if using on websites with https?
John, thanks for the very helpful article. I design websites for local businesses and sometimes I do not want my clients to know what plugins I use, I wonder if Symlinks can help. Please advise!
thanks John, good tip!
Are there plugins that write back to the file system (like to store temp/cache/config data in instead of the database)?
You did recommend against production use. And this situation would be one big no-no scenario.
John, Thanks for a great and explaining article! We have different websites with the same plugins and we might try sharing them with symlinks solution.
Regards
This trick can save hosting space. Very good.