Report this

What is the reason for this report?

I broke my wordpress setup for my droplet

Posted on October 13, 2024

I mistyped my domain name information. How can I fix this. I have dumped two urls restarting



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Hey there!

As this is a fresh new Droplet, the quickest option would be to just delete the old one and create a new one.

Alternatively, you can fix the domain name issue in WordPress by updating the site URL and home URL. Here’s how you can do it:

1. Update via WP-CLI (if you have it installed):

Using the wp CLI you can easily update the URLs directly from your terminal. Run the following commands:

wp option update home 'http://your-correct-domain.com'
wp option update siteurl 'http://your-correct-domain.com'

Make sure to replace http://your-correct-domain.com with your actual domain.

2. Update via MySQL:

If you don’t have WP-CLI, you can update the URLs directly in the database. Follow these steps:

  • Log into your Droplet using SSH.
  • Access your MySQL database:
    mysql -u root -p
    
  • Once inside MySQL, switch to your WordPress database:
    USE your_database_name;
    
  • Now, run these SQL queries to update the URLs:
    UPDATE wp_options SET option_value = 'http://your-correct-domain.com' WHERE option_name = 'home';
    UPDATE wp_options SET option_value = 'http://your-correct-domain.com' WHERE option_name = 'siteurl';
    

Replace http://your-correct-domain.com with your actual domain name.

3. Update via wp-config.php (Temporary Fix):

If you’re locked out of the admin area, you can hard-code the URLs directly in your wp-config.php file as a temporary fix. Open the file and add these lines:

define('WP_HOME','http://your-correct-domain.com');
define('WP_SITEURL','http://your-correct-domain.com');

Once you’re able to access the admin dashboard, remember to remove these lines after fixing the URLs permanently.

This should get your WordPress setup back on track! Let me know if you need further help!

- Bobby

Heya,

You have two options the way I see it. The first one is to find anywhere your domain has been hardcoded in terms of WordPress and change it or just create a new Droplet and add the proper domain.

I’ll go for the second choice in you don’t have anything else on that Droplet. I mean it’s not a problem to delete the current one and just create a new one.

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.