Hello @dessinerwebsites
Add the following two lines of code to the top of the wp-config.php
file after replacing https://www.example.com
with your site URL, then save the file.
define('WP_SITEURL', 'https://www.example.com');
define('WP_HOME', 'https://www.example.com');
That’s all, please try accessing your WordPress Admin panel now.
@dessinerwebsites
Changing the URL settings in WordPress can indeed lock you out of the Dashboard. Fortunately, you can override those values by adding some constants in wp-config.php
file. Since the process is a bit technical, I’ll provide step-by-step instructions. You’ll need to access your website’s hosting control panel to do this or you can use FTP/SFTP as well.
Here’s how you can do it:
- Access your WordPress files. You can do this via FTP, or through a file manager in your web hosting control panel.
- Find the wp-config.php file. It’s usually in the root directory of your WordPress installation.
- Open wp-config.php in a text editor.
- Add the following lines of code towards the top of the file, just after the
<?php
line replacing http://myawesomesite.com
with your site’s URL:
define('WP_HOME', 'http://myawesomesite.com');
define('WP_SITEURL', 'http://myawesomesite.com');
5. Save your changes and close the file.
After doing this, WordPress will use the URLs defined in wp-config.php
instead of the ones in the database. This means you can’t change these settings from the dashboard unless you remove these lines from wp-config.php
I hope this helps
@Gagan Deep Singh sir can you share me the screen shorts, where i should go and change, that would be really helpful.
@dessinerwebsites
Your site appears to be hosted on simply.com hosting platform. I do not have an account in there, to capture screenshots, but here are the steps you can follow:
- Log in to your Simply.com control panel: Open your web browser and navigate to Simply.com. Enter your username and password to log in.
- Access the File Manager: Once logged in, look for the “File Manager” option. This will allow you to access the files and folders of your WordPress installation.
- Navigate to your WordPress directory: The
wp-config.php
file is located in the root directory of your WordPress installation. This is typically the public_html
but since you have it within a subdirectory, it will be at public_html/wordpress
.
- Open the wp-config.php file: Once you’ve located the wp-config.php file, click on it and then click the “Edit” or “Code Editor” button (this might vary depending on the interface).
Follow the rest of the instructions as stated in earlier reply
@niyaswp
can you share me the screen shorts, where i should go and change, that would be really helpful.
@dessinerwebsites
You do not need to write the same message twice as we can see each others’ replies.
Also, it’s not a good practice to share credentials like you did in the text file. So please remove it as soon as possible and ensure you change the database username and password later.
As for why the Error establishing a database connection issue, you seem to have removed one line that defines the database name in the wp-config.php
It should have been something like
define( 'DB_NAME', 'database_name_here' );
Add it back in the wp-config.php
with the correct database name and it will start working.
Also you only added one line
define('WP_SITEURL', 'http://***********');
Instead add both WP_HOME
AND WP_SITEURL
constants.
Also, I see that you used http
instead of https
in the URL, please change it to https
as well.