Before making any changes to your website’s database, it’s important to make a backup in case anything goes wrong. Once you’ve made a backup, you can follow these steps to change your WordPress URL from HTTP to HTTPS from the database:

  1. Log in to your hosting account and navigate to the cPanel dashboard.
  2. Open phpMyAdmin and select your WordPress database from the left-hand menu.
  3. Click on the “wp_options” table and look for the “siteurl” and “home” rows.
  4. Edit both rows by clicking the pencil icon to the left of the row.
  5. Change the “option_value” field for both rows to your new HTTPS URL, and click the “Go” button to save the changes.
  6. Verify that the changes have been made by accessing your WordPress site’s URL with HTTPS.

When we update the database content links without using the plugin then many problems are generated if we update the query without taking a backup. In MySQL database, we have to use the following SQL query for a different table.

UPDATE wp_options SET option_value = replace(option_value, 'http://codenskills.com', 'https://codenskills.com') WHERE option_name = 'home' OR option_name = 'siteurl';

UPDATE wp_postmeta SET meta_value = replace(meta_value,'http://codenskills.com','https://codenskills.com');
UPDATE wp_posts SET guid = replace(guid, 'http://codenskills.com','https://codenskills.com');

UPDATE wp_posts SET post_content = replace(post_content, 'http://codenskills.com','https://codenskills.com');

UPDATE wp_posts SET pinged = REPLACE(pinged, 'http://codenskills.com', 'https://codenskills.com')WHERE pinged LIKE '%http://codenskills.com%';

if the WordPress page has been made by WP page-bakery or editor then the following query must be run


UPDATE wp_posts SET post_content = REPLACE(post_content, 'src="http://codenskills.com', 'src="https://codenskills.com')WHERE post_content LIKE '%src="http://codenskills.com%';

UPDATE wp_posts SET post_content = REPLACE(post_content, "src='http://codenskills.com", "src='https://codenskills.com")WHERE post_content LIKE "%src='http://codenskills.com%";

UPDATE wp_posts SET post_content = REPLACE(post_content, 'href="http://codenskills.com', 'href="https://codenskills.com')WHERE post_content LIKE '%href="http://codenskills.com%';

UPDATE wp_posts SET post_content = REPLACE(post_content, "href='http://codenskills.com", "href='https://codenskills.com")WHERE post_content LIKE "%href='http://codenskills.com%";

If you have any caching plugins or services enabled, it’s recommended to clear the cache after making changes to the database to ensure that your website displays correctly with the new URL. If you encounter any issues, you can restore the backup you made earlier and try again or seek help from a professional developer.