How to Fix WordPress Site URL Typos: A Complete Guide for Beginners

No Comments

When setting up or managing a WordPress website, it’s surprisingly easy to make a small typo in your Site URL or WordPress Address (URL) in the WordPress dashboard. This seemingly minor mistake can instantly lock you out of your website and dashboard, leaving you scrambling for a fix. But don’t worry — this guide will walk you through multiple proven methods to fix this issue and regain access to your WordPress site.


Why a Typo in WordPress URL Can Break Your Site

WordPress relies heavily on the Site URL and Home URL settings to function correctly. These URLs define where your core WordPress files are located and where users can access your site. A typo or incorrect URL can cause:

  • Inability to access the WordPress dashboard.
  • Broken links and missing resources.
  • Site redirection to an invalid or non-existent address.

Now, let’s explore different methods to fix this issue. Whether you have access to phpMyAdmin, wp-config.php, or even SSH, we’ll cover every scenario.


Method 1: Fix WordPress URL via wp-config.php

If you cannot access the WordPress admin dashboard, the quickest way to fix the URL is through the wp-config.php file.

Step 1: Access wp-config.php

  • Log in to your hosting server using FTP, File Manager in your hosting panel, or SSH.
  • Navigate to the root folder of your WordPress installation (usually public_html or /var/www/html).

Step 2: Edit wp-config.php

Add the following lines to the file, just above the line that says /* That's all, stop editing! Happy publishing. */:

define('WP_HOME', 'https://yourcorrectdomain.com');
define('WP_SITEURL', 'https://yourcorrectdomain.com');

Replace yourcorrectdomain.com with your actual domain.

Step 3: Save and Restart Services

  • Save the changes.
  • If you have SSH access, restart services:
sudo systemctl restart nginx
sudo systemctl restart php-fpm

Step 4: Access Your Site

Open your browser and visit https://yourcorrectdomain.com/wp-admin.


Method 2: Fix WordPress URL via phpMyAdmin

If you have access to your database through phpMyAdmin, this method is straightforward.

Step 1: Log in to phpMyAdmin

  • Access phpMyAdmin from your hosting control panel.
  • Select your WordPress database from the left sidebar.

Step 2: Locate the wp_options Table

  • Click on the wp_options table.
  • Look for the rows with siteurl and home in the option_name column.

Step 3: Update the URLs

  • Click the Edit icon next to siteurl.
  • Update the option_value field to:
https://yourcorrectdomain.com
  • Do the same for home.
  • Click Save.

Step 4: Test Your Site

Visit your website to ensure it’s working.


Method 3: Fix WordPress URL with WP-CLI

WP-CLI (WordPress Command Line Interface) is a powerful tool if you have terminal access.

Step 1: Log in to Your Server via SSH

ssh root@your-server-ip

Step 2: Navigate to WordPress Directory

cd /var/www/html

Step 3: Update URLs

wp option update siteurl 'https://yourcorrectdomain.com'
wp option update home 'https://yourcorrectdomain.com'

Step 4: Restart Services and Test

sudo systemctl restart nginx
sudo systemctl restart php-fpm

Visit your site to ensure everything is working.


Method 4: Update URLs via functions.php

If the other methods are not an option, you can use the theme’s functions.php file.

Step 1: Access functions.php

  • Go to /wp-content/themes/your-theme/functions.php.

Step 2: Add the Following Code

update_option('siteurl', 'https://yourcorrectdomain.com');
update_option('home', 'https://yourcorrectdomain.com');

Step 3: Save and Test

  • Save the file.
  • Visit your website.
  • Remove the added code once the site is working.

Method 5: Clear Caches and Restart Services

Sometimes, cache can prevent your changes from taking effect.

  • Clear your WordPress Cache (if using plugins like W3 Total Cache or WP Super Cache).
  • Clear your browser cache.
  • Restart web services:
sudo systemctl restart nginx
sudo systemctl restart php-fpm

Preventing Future WordPress URL Typos

  • Always double-check your URLs before saving changes.
  • Backup your WordPress database regularly.
  • Use WP-CLI for quick and reliable management.
  • Enable SSL/HTTPS correctly to avoid redirect errors.

Final Thoughts

Mistakes happen, especially when managing WordPress settings. The good news is that fixing a typo in your WordPress Site URL is usually quick and straightforward if you follow these methods. Whether you use wp-config.php, phpMyAdmin, WP-CLI, or functions.php, you now have a reliable toolkit to resolve this issue.

If you found this guide helpful, consider sharing it with others facing the same problem. And remember, prevention is always better than cure — keep regular backups and handle critical settings with care.

Need more help? Drop your questions in the comments below!


About us and this blog

We are a digital marketing company with a focus on helping our customers achieve great results across several key areas.

Request a free quote

We offer professional SEO services that help websites increase their organic search score drastically in order to compete for the highest rankings even when it comes to highly competitive keywords.

Subscribe to our newsletter!

More from our blog

See all posts

Leave a Comment