DEV Community

Brandon Zhang
Brandon Zhang

Posted on

Working with WordPress hosted on AWS Lightsail

1. PHPStorm Remote Host folder mapping.

Screenshot showing folder mapping on PHPStorm

Screenshot showing project folders on AWS Lightsail remote host

2. SSH into remote server directly inside PHPStorm.

If we want to upload local plugin files into WordPress plugin folder, we need to change the folder permission on plugins folder on our remote host.

Screenshot of PHPStorm SSH option menu

3. Using WP CLI to check database tables.

sudo wp db query "SHOW TABLES LIKE 'wp_table_name'"

sudo wp db query "SELECT * FROM wp_table_name"

  • Remove all rows: sudo wp db query "TRUNCATE TABLE wp_jobs"
  • Add a new column user_id: sudo wp db query "ALTER TABLE wp_career_tracker_jobs ADD COLUMN user_id INT DEFAULT 0"
  • Drop table: sudo wp db query "DROP TABLE wp_table_name"
  • Get transient value: sudo wp transient get activation_token

Top comments (0)