Flash Sale:75% Off Hosting + Free DomainEnds in13h47m14sView Plans
Hostvento logoHostvento

Useful SSH commands for WordPress users

SSH lets you manage your WordPress site by typing commands. This guide lists simple commands that save time.

WordPress2 min read12 screenshots

What is SSH?

SSH is a safe way to connect to your server and type commands. It is like sending written orders to a helper instead of clicking buttons. You need SSH access on your hosting plan. Ask Hostvento support whether your plan includes it.

Connect to your server

Open a terminal. This is a window where you type commands. Run this, using the details from your welcome email:

ssh username@your-server-address

This logs you in. You will be asked for your password.

Move around and look at files

pwd

Shows the folder you are in.

ls -la

Lists all files, including hidden ones.

Screenshot: Lists all files, including hidden ones.
cd public_html

Moves into the public_html folder, where websites often live.

Screenshot: Moves into the public_html folder, where websites often live.

Back up before you change things

cp wp-config.php wp-config.php.bak

Makes a copy of the settings file.

tar -czf site-backup.tar.gz public_html

Packs your whole site into one compressed file.

Warning: Commands such as rm delete files for good. Check the name twice and keep a backup.

WP-CLI commands

WP-CLI is a tool made for managing WordPress from the command line. Run these inside your WordPress folder.

wp core version

Shows your WordPress version.

wp core update

Updates WordPress.

Screenshot: Updates WordPress.
Screenshot: Updates WordPress.
wp plugin list

Lists your plugins and their status.

wp plugin update --all

Updates every plugin.

wp plugin deactivate plugin-name

Turns off one plugin. This helps when a plugin breaks your site.

Screenshot: Turns off one plugin. This helps when a plugin breaks your site.
Screenshot: Turns off one plugin. This helps when a plugin breaks your site.
wp cache flush

Clears the saved object cache.

Screenshot: Clears the saved object cache.
wp user list

Shows all users on your site.

wp db export backup.sql

Saves your database to a file.

Check file size and space

du -sh wp-content

Shows how much space the folder uses.

Tip: Press the up arrow key to repeat your last command. Press Tab to finish a file name.

Quick recap

  • SSH lets you control your server with typed commands.
    Screenshot: SSH lets you control your server with typed commands.
  • Use ls, cd and pwd to move around.
  • WP-CLI handles updates, plugins and users fast.
    Screenshot: WP-CLI handles updates, plugins and users fast.
    Screenshot: WP-CLI handles updates, plugins and users fast.
  • Back up first, and be careful with delete commands.
    Screenshot: Back up first, and be careful with delete commands.
    Screenshot: Back up first, and be careful with delete commands.