Can’t Access WordPress Admin After Changing URL? Here is the Fix

In WordPress by Fathi Arfaoui9 CommentsLast Updated: September 28th, 2017

If you’ve tried to edit your WordPress blog setting page under the ”General Setting”, and now you can’t access your WordPress admin after changing the URL, by adding, or deleting the,www then, this is a natural error, and we’ll solve it in one minute. But, why you get that error and why you can’t login to WordPress dashboard?

First of all, you’re not the only one who makes this mistake. Most of the new bloggers will try to edit their blog setting anywhere, but the problem is if you’re not familiar with WordPress. You can get some problems when changing anything wrong.

So, make sure the next time to ask, or search for settings that you want to edit, and you’re not sure about them. That will save you time and avoid problems.

The problem with adding or deleting the www in your site URL, and WordPress address is that the file ”wp-config.php” located in your WordPress root, will see your new setting as a new domain name that it can’t work with. So, you can’t login to your WordPress dashboard.

Now, the solution is simple, all you have to do is to add the following code at the end of your ”wp-config.php” file.

define('WP_HOME','http://www.yourdomain.com');
define('WP_SITEURL','http://www.yourdomain.com');

Of course, you should change yourdomain with your own domain name.

To make things even more simple, let’s add that code together:

Fixing the WordPress URL in htaccess

The first thing that you need to do is to login to your cPanel account, and then locate the file opener

Related Content:  10 Professional and Premium Magazine WordPress Themes

Can't access WordPress Admin after changing Url

Now, you have all your files, just search for the file ”wp-config.php” and click on ”edit file”.

 edit wp-confing fileAll you have to do now is to add the code at the end of the file and save it.

You have to clear your browser cache if the problem persists. Then, reload your page and you will get access to your WordPress admin dashboard. You will notice that you can’t change the URL from your ”General Setting” page, and this is normal because you changed it directly from the ”wp-config.php” file, it’s simpler and safer.

In other cases, you can change the URL from your WordPress dashboard, directly, and it can be changed another time again. Things become easier with the latest WordPress versions, but please remember to make a backup before doing anything in your blog settings, especially, if you’re a newbie.

That can cause problems and it’s not easy to find solutions for every specific error online. The WordPress forum is a great place to ask questions and find solutions, but, you can get a response instantly and you will never get a reply in other cases.

People there are volunteers, and not all of them are really helpful as you expect. So, make things easy for you and never change your URL if you’re not sure about your settings.

If you really care about your website, you should verify that you can access your blog files through FTP like Filezilla. Also, make sure that you can login and edit your files directly from your cPanel account. If one method is not working for you, you still have another access to your WordPress files and make the changes or correct things.

About Fathi Arfaoui

Fathi Arfaoui: Blogger, and the founder and owner of Trustiko.com. He shares Business, Blogging, WordPress, Web Safety, and Blogging tips to build better websites and blogs. Also, he shares online marketing strategies and recommendations.

Comments

  1. Thanks bud, saved me. I just couldn’t get Webmaster Tools to return anything but a redirect for my homepage. I did the wp-config.php edit for Home and Address, and added the trailing “/”, and voila!

    Thanks again!

    Ron

  2. Hey, everything worked, I can now access my dashboard, but it looks very strange, like just plain text.
    Just white background and black/blue texts and links.

    Do you know how can I fix this?

    1. Author

      Try to clear your browse cache first, then login again. Also, it can be caused by slow connection or the browser itself, So, change browser and see how it will look like.

  3. I am having the same difficulty after changing URL in the word press ‘general setting’ Following steps above, I see a number of ‘define’ do I change all.
    Thank you!

    // ** MySQL settings – You can get this info from your web host ** //
    /** The name of the database for WordPress */
    define(‘DB_NAME’, ‘dacheah_wrdp1’);

    /** MySQL database username */
    define(‘DB_USER’, ‘dacheah_wrdp1’);

    /** MySQL database password */
    define(‘DB_PASSWORD’, ‘qHe5eY6hzB5u’);

    /** MySQL hostname */
    define(‘DB_HOST’, ‘localhost’);

    /** Database Charset to use in creating database tables. */
    define(‘DB_CHARSET’, ‘utf8’);

    /** The Database Collate type. Don’t change this if in doubt. */
    define(‘DB_COLLATE’, ”);

  4. Oh, my gosh. It worked. Thank you! I LOVE YOU, I LOVE YOU, I LOVE YOU!!!

Leave a Comment