So you found yourself locked out of your WordPress site after changing the WordPress Address (URL) or Site Address (URL) in General Settings?
Don’t worry, I’ve got you covered with some simple solutions tailored to your hosting environment.
First things first, let’s get to why you can’t access the WordPress site after changing the URL.
Understand the Issue: Can’t Access WordPress Site After Changing URL 🚫
When you change your website’s URL settings, the problem arises because the page where you can revert these changes gets misplaced. Your site’s URLs shift to the new address, including the URL of the settings page itself.
However, the physical location of your WordPress files remains unchanged. So, when you try to access the WordPress admin area, you’re essentially trying to reach a page that no longer exists.
How to Fix This? 🛠️
As you can’t alter the URL from the WP-Admin dashboard anymore, we’ll need to do it manually. But don’t fret, it’s simpler than it sounds. We’ve got a few methods here, but we’ll focus on the easy ones and also specific to your hosting:
- Change the WordPress URL via phpMyAdmin.
- Change the WordPress site URL in the
wp-config.php
file.
Let’s dive into the first solution:
Solution 1: Change the WordPress site URL via phpMyAdmin.
The next approach to resolve the “Can’t access WordPress after changing site URL” issue involves manually updating the site URL value in the WordPress database.
Important Reminder:
Making direct changes to the WordPress database directly can affect your website’s function if not done correctly. If unsure, consult a developer and always back up your database before making changes.
Step 1 : Access phpMyAdmin
Access phpMyAdmin In Hostinger
- Login to your Hostinger Account
- Navigate to Websites > Click on the “Manage” button for the website you wish to recover.
- Click on ‘Database’ > Scroll down to ‘List of Current MySQL Databases And Users’
- Click on ‘Enter phpMyAdmin’
Access phpMyAdmin In cPanel
- Login to your hosting cPanel and open phpMyAdmin.
Step 2: Change the Site URL in phpMyAdmin
- On the phpMyAdmin files find “wp_options” and open it.
- In the ‘option_name’ column, find ‘siteurl’ and ‘home’ entries.
- Click on the ‘Edit’ button of either the “siteurl” or “home” entries.
- Enter the correct URL (Previous URL) in the ‘option_value’.
- Scroll down a bit and click on the ‘Go button’.
- Do the same for the remaining entry.
Step 3: That’s it. Now, try accessing your WordPress site and log in to the WP-Admin dashboard.
Solution 2: Change the WordPress Site URL via Editing the wp-config.php File
This method to address the ‘Can’t access WordPress after changing site URL’ issue involves inserting two lines of code into the WordPress configuration file ‘wp-config.php‘.
Note: The wp-config.php file contains vital information like your WordPress database details, username, password, and more. Handle this file with care and avoid unnecessary edits.
Step 1: Access ‘wp-config.php’ file
Access ‘wp-config.php’ file In Hostinger
- Login to your Hostinger Account
- Navigate to Websites > Click on the ‘manage’ button of the Website you want to recover
- Click on ‘File Manager’ > This will redirect you to a new tab
- Click on ‘My Files’ > open the ‘public_html’ folder
- Find the ‘wp-config.php’ file. > and double-click on it. (Or right-click on it and hit the edit option)
Access ‘wp-config.php’ file In cPanel
- Login to your WordPress hosting cPanel.
- Under the Files section, click on File Manager.
- Open the ‘public_html’ folder.
- Find the ‘wp-config.php’ file. > and double-click on it. (Or right-click on it and hit the edit option)
Step 2: Add Code in the ‘wp-config.php’ file
- Add the following two lines of code to the top
- Change the site URL (https://www.domain.com) in code with your correct URL (Previous URL)
- Save the changes.
Code :
define('WP_SITEURL', 'https://www.domain.com');
define('WP_HOME', 'https://www.domain.com');
Step 3: That’s it. Now, try accessing your WordPress site and log in to the WP-Admin dashboard.
Conclusion🙌
If this guide helped you tackle the “Can’t access WordPress after changing site URL” issue. And get your WordPress site back, I’d love to hear about your success in the comments below!
But if you’re still facing the issue, Drop a comment below. Let’s work together to get your WordPress site back on track.
Your feedback and questions are valuable, and I’m here to help.
This discussion might also benefit others dealing with similar challenges, so don’t hold back from sharing.