6. Reinstall Wordpress
Step 1: Make a Backup (Optional but Recommended)
Before making any changes, it is recommended to make a backup of your current installation, just in case you need to recover something later.
Step 2: Delete WordPress Files
Go to the folder where your WordPress installation is installed. Usually, it is located in /var/www/html/wordpress or a similar path.
This command will delete all WordPress files. Make sure there are no files you want to keep.
Step 3: Delete Database
If you want to delete the current database and create a new one, you can do so from the MariaDB console:
Next, run the following commands:
Step 4: Download and Install WordPress
Download the latest version of WordPress:
This will unzip WordPress directly into the wordpress folder.
Step 5: Configure wp-config.php
Copy the sample configuration file and edit it:
Configure the database details:
Step 6: Set Permissions
Make sure the permissions for your files and folders are correct:
Step 7: Install WordPress
Now, open your browser and go to the URL of your WordPress installation (e.g. http://your_domain/wordpress). You should see the WordPress installation screen. Follow the instructions to complete the installation.