This guide walks you through setting up SFTP (SSH File Transfer Protocol) access to a WordPress Multisite installation. You’ll learn how to connect securely, navigate the network’s file structure, and upload or edit files without breaking anything. We’ll cover the essential prerequisites, the exact steps to get connected, common pitfalls, and how to fix issues when they arise.
What You’ll Need
- An SFTP client (e.g., FileZilla, WinSCP, or the built-in terminal on macOS/Linux).
- Your hosting account’s SFTP credentials: hostname (often your domain or IP), username, password, and port (usually 22).
- If you use SSH keys, you’ll need the private key file and its passphrase.
- Access to your hosting control panel (like cPanel or Plesk) in case you need to reset credentials or check the exact hostname.
- Basic familiarity with the WordPress directory structure (wp-content, themes, plugins, uploads).
Step-by-Step
- Get your SFTP credentials. Log into your hosting control panel. Look for an “FTP” or “SFTP” section. If you don’t see SFTP specifically, check the general FTP settings—many hosts use the same credentials for both. Note the hostname (often like
ftp.yourdomain.comor a server IP), the username, and the port (default 22). If you don’t have a password, you may need to create one or use an SSH key pair. - Open your SFTP client. Launch FileZilla, WinSCP, or your terminal. In a terminal, the command is
sftp username@hostname(you’ll be prompted for the password or passphrase). In FileZilla, fill in the Host, Username, Password, and Port fields in the Quickconnect bar, then click “Quickconnect.” - Connect to your server. Accept any security certificate prompts (they are normal for SFTP). You should now see a directory listing—typically your home directory or the root of your hosting account. This is not yet your WordPress installation.
- Navigate to your WordPress root. Look for the document root folder, often named
public_html,www, orhtdocs. Double-click to enter it. If your Multisite is installed in a subdirectory (e.g.,public_html/mysite), navigate into that folder. You should see files likewp-config.php,wp-settings.php, and folders likewp-admin,wp-content, andwp-includes. - Understand the Multisite file layout. In a standard Multisite, the core files and the
wp-contentfolder are shared across all sites in the network. Theuploadsfolder insidewp-contentis organized by site ID (e.g.,sites/2/,sites/3/). Each site’s media files are in its corresponding subfolder. Plugins and themes are shared, so any changes you make affect the entire network. - Upload or edit files. To upload a file, drag it from your local machine to the remote folder. To edit, right-click the file and choose “View/Edit” (FileZilla) or “Edit” (WinSCP). Make your changes, save, and the client will ask to upload the modified file. For large uploads, consider using a zip file and extracting it on the server via a file manager in your hosting control panel, especially if your connection is slow.
- Set correct file permissions. After uploading, check that files are set to
644and folders to755. In FileZilla, right-click a file or folder, select “File permissions,” and set the numeric value. Incorrect permissions can cause white screens or file write errors. - Disconnect when done. Always log out properly to avoid leaving open connections. In FileZilla, click the disconnect icon (the red X). In the terminal, type
exit.
Common Mistakes
- Using the wrong directory. Uploading a theme to
wp-content/themesinstead of the correct subfolder (likewp-content/themes/mytheme) is a classic error. Always double-check the path. - Editing core files. Modifying
wp-adminorwp-includesfiles directly can break the entire network. Use a child theme or a custom plugin for changes. - Ignoring the site ID in uploads. Uploading a media file to the wrong site’s folder will make it invisible in the media library. Use the correct
sites/IDpath. - Forgetting to set permissions. Newly uploaded files might inherit restrictive permissions, causing PHP errors. Always verify permissions after upload.
- Confusing SFTP with FTPS. SFTP (SSH) is different from FTPS (FTP over SSL). Make sure your client is set to SFTP, not FTPS, or the connection will fail.
Tips
- Use a static IP or SSH keys for security. If your IP changes often, consider using SSH keys instead of passwords. Many hosts allow you to add your public key in the control panel.
- Keep a local backup. Before making any changes, download the file you’re about to edit to your computer. This way, you can restore it if something goes wrong.
- Use a staging site. Test theme or plugin changes on a staging copy of your Multisite before applying them to production.
- Learn the command line. If you’re comfortable with the terminal, you can use
sftpcommands likeput,get,cd, andlsto work faster. - Check the network’s
wp-config.phpfor constants. Some Multisite setups defineWP_CONTENT_URLor similar constants; if you see them, be aware that they might affect how files are served.
Troubleshooting
- Connection refused or timeout. Verify the hostname and port. If you’re using a shared IP, the hostname might be different. Check if your hosting provider blocks SFTP on port 22; try port 2222 or a custom port from your control panel. Also, ensure your local firewall or router isn’t blocking the connection.
- Authentication failed. Double-check the username and password. If you’re using SSH keys, ensure the private key file is correctly selected and the passphrase is correct. Some hosts require you to add your public key to the account before key-based login works.
- Permission denied when uploading. This usually means the target folder is not writable by your SFTP user. Check the folder’s permissions—it should be owned by your user. If you’re in a shared hosting environment, you may need to use the hosting file manager to change ownership.
- Files appear but are not visible in WordPress. If you upload a theme or plugin and it doesn’t show up, clear any caching (server-side or plugin cache). Also, verify that the file structure is correct—the main plugin file must be in the plugin’s root folder.
- White screen after editing a file. This is often a PHP syntax error. Restore the original file from your backup. If you don’t have a backup, check the PHP error log in your hosting control panel to see the exact error line.
- SFTP works but is extremely slow. For large files, try zipping them locally and uploading the zip, then extracting it on the server using the file manager. This is often much faster.
Frequently Asked Questions
Can I use the same SFTP credentials for all sites in my Multisite?
Yes, SFTP credentials are tied to your hosting account, not to individual sites. You’ll have one set of credentials that gives you access to the entire file system, including all sites in the network.
How do I find the site ID for a specific subsite?
In your WordPress admin, go to My Sites → Network Admin → Sites. The ID is shown in the first column. Alternatively, you can look in the wp_blogs table in your database, but the admin screen is easier.
What is the difference between SFTP and FTP?
FTP is the traditional file transfer protocol, which sends data in plain text. SFTP (SSH File Transfer Protocol) runs over an encrypted SSH connection, making it much more secure. Always use SFTP if your host offers it.
Do I need to install anything on the server to use SFTP?
No, SFTP is a server-side service. Your hosting provider has it enabled, and you just need a client on your computer to connect. No server-side installation is required.
Can I edit files directly via SFTP, or should I use the WordPress admin?
You can edit files directly via SFTP, but be careful. For themes and plugins, it’s often safer to use the WordPress admin’s built-in editor (though it’s discouraged for production). For configuration files like wp-config.php, SFTP is the standard method.
What should I do if I accidentally delete a file via SFTP?
If you have a backup, restore it immediately. If not, you can try to re-download the original file from the WordPress repository (for core files) or from the theme/plugin developer. For custom files, you may need to recreate them from memory or a local copy.
Related
Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.
More cards in this drawer
- Microsoft Surface Duo: The Foldable Phone Story
- Samsung SM-T813 Hard Reset: Step-by-Step Guide
- Mafia Clash Codes: Real Meanings & Usage
- Remove Programs from Mac: Full Uninstall Guide
- Project Sentinel Morning Digest: Data Stack Failure Alerts
- Best KVM VPS Hosting: Top Picks & Guide