The instructions in this guide will show you how to generate an SSH key pair, add the public SSH key to your WordPress.com account, and then attaching the public SSH key to any sites you’d like to use it with.
This section of the guide applies to sites with the WordPress.com Business and Commerce plan. If you have a Business plan, make sure to activate it. For free sites and sites on the Personal and Premium plans, upgrade your plan to access this feature.
SSH keys are a more secure way to connect via SSH. An SSH key pair comprises a private and public key. The public key is configured on the server, and the private key remains on the local computer. Once configured, SSH keys do not require you to enter a password every time you connect, as the key pair handles authentication. If the private key on the local computer matches the public key configured on the server, the user can connect.
You can add one public key per WordPress.com account, which you can then attach to multiple sites. Each site can have multiple keys attached, one per privileged user.
If you don’t have an SSH key pair on your computer, connecting to SSH via password authentication also works.
You can generate SSH key pairs on Mac, Windows, and Linux. Once you create your key pairs, you can then add your public key to your WordPress.com account.
To generate an SSH key pair using macOS, take the following steps:
- Open the Terminal.
- Run the command
ssh-keygen -t ed25519. - When prompted, enter the name of the file where you wish to store your key or press Enter to accept the default file name. On MacOS or Linux systems, the default location is the
.sshdirectory in your home directory. - When prompted, type a secure passphrase to use with your key.
This will save a public and a private key in the chosen location. The public key, which you’ll need for your WordPress.com account in the next step, will include the .pub extension.
To generate an SSH key using Windows, take the following steps:
- Open PowerShell or cmd prompt.
- Run the command
ssh-keygen -t ed25519. - When prompted, enter the name of the file where you wish to store your key or press Enter to accept the default file name.
- When prompted, type a secure passphrase to use with your key.
This will save a public and a private key in the chosen location. The public key, which you’ll need for your WordPress.com account in the next step, will include the .pub extension.
Before adding your SSH key to your WordPress.com account, you need to copy it to your clipboard. There are two ways to do this using your computer terminal:
macOS
pbcopy < ~/.ssh/id_rsa.pub
Windows
clip < ~/.ssh/id_rsa.pub
Linux
cat ~/.ssh/id_rsa.pub
If your SSH public key file uses a different name than the one mentioned above, edit the code to match the filename on your computer.
After copying your public SSH key to your clipboard, you will be able to add it to your account by following these steps:
- Visit your WordPress.com profile: https://wordpress.com/me
- On the sidebar, click on Security.
- Click on the “SSH Key” option available in the security checklist.
- Paste your SSH key into the “SSH public key” field.
- Click on the “Save SSH Key” button.

Once you add your SSH key to your WordPress.com account, you should follow the steps in the next section of this guide to attach it to each site you’d like to use it on.
After adding an SSH key to your account, it will be necessary to attach it to the site you want to connect via SSH. To attach your SSH key to a site, follow these steps:
- Visit your Sites page: https://wordpress.com/sites/
- Click the ⋮ next to your site and select Settings.
- Scroll down and click SFTP/SSH.
- Use the SSH Keys dropdown to select the desired key:

- Click on the Attach SSH Key to Site button.
Once your SSH key is attached to the site, you can use the SSH key when authenticating over SSH.
If you no longer want to connect to a site using your SSH key, you can detach the key from the site by following these instructions:
- Visit your Sites page: https://wordpress.com/sites/
- Click the ⋮ next to your site and select Settings.
- Scroll down and click SFTP/SSH.
- Under the SSH section, locate the SSH key you want to remove.
- Click on the Detach button to remove the key from the site.
The SSH key will still be associated with your WordPress.com account until you remove it.
Follow the below steps to update your public SSH key:
- Visit your WordPress.com profile: https://wordpress.com/me
- On the sidebar, click on Security.
- Click on the “SSH Key” option available in the security checklist.
- Click on the “Update SSH key” button next to the key you wish to update.
- Paste your updated SSH key to the “New SSH Public Key” field.
- Click the “Update SSH Key” button to save the change.
Removing an SSH key from your WordPress.com account will also detach it from each site it’s associated with. To remove an existing SSH Key from your WordPress.com account, follow these steps:
- Visit your WordPress.com profile: https://wordpress.com/me
- On the sidebar, click on Security.
- Click on the “SSH Key” option available in the security checklist.
- Click on the “Remove SSH Key” button displayed beside the existing key.
- A confirmation message will be displayed. Click the OK button to confirm that you want to remove the key.