Define new website url in wordpress
In WordPress, a new website URL is defined by setting the site_url
and home_url
options in the wp_options
table. Here's how to do it:
Method 1: Using the WordPress Admin Dashboard
- Log in to your WordPress dashboard.
- Go to Settings > General.
- In the WordPress Address field, enter the new URL of your website (e.g.,
https://example.com
). - In the Site Address field, enter the new URL of your website (e.g.,
https://example.com
). - Click Save Changes.
Method 2: Using the WordPress Database
- Connect to your WordPress database using a tool like phpMyAdmin.
- Navigate to the
wp_options
table. - Find the
site_url
andhome_url
options and update their values to the new URL (e.g.,https://example.com
). - Click Go to save the changes.
Method 3: Using a Plugin
- Install and activate a plugin like WP Site URL Changer or Site URL Manager.
- Configure the plugin to update the site URL to the new value (e.g.,
https://example.com
). - Save the changes.
Important Notes:
- Make sure to update both the
site_url
andhome_url
options to ensure that your website functions correctly. - If you're updating the site URL, you may need to update any hardcoded URLs in your theme or plugins.
- If you're moving your website to a new domain, you may need to update the
wp_options
table to reflect the new domain.
After updating the site URL, you may need to update any external links, such as social media profiles or email newsletters, to reflect the new URL.