Reinstalling WordPress Core Files Using WP-CLI

This guide explains how to reinstall the WordPress Core files using WP-CLI.

Prerequisites

  • Backup your WordPress site (optional but recommended).

Steps to Reinstall WordPress Core

  1. Login to Terminal/SSH Access the server via SSH or using the cPanel terminal.
    - All packages except Amethyst come with SSH - you may need to enable it first following this guide here
  2. Navigate to the WordPress Installation Directory Use the following command to go to your WordPress root directory:
cd /public_html
  1. Ensure You're in the Correct Directory Confirm that you're in the WordPress directory by checking for wp-config.php:
ls
  1. Reinstall WordPress Core Files Execute the following command to reinstall the WordPress core files:
wp core download --force

This command downloads and replaces core files without altering your wp-config.php or wp-content.

  1. Clear Cache (optional) Clear your cache if necessary:
wp litespeed-purge all
  1. Verify Site Check your site to ensure it’s working correctly.
  2. Update Database (if needed) If prompted, update your database:
wp core update-db


How did we do?


Powered by HelpDocs (opens in a new tab)
© Krystal Hosting Ltd 2002–