Pass internal link http to https

Alex_Roma89

Junior Member
Joined
Aug 18, 2022
Messages
125
Reaction score
56
Hi all friends, do any of you know a way to change all internal links a few years old from http to https automatically? For now I'm doing it by hand, it's boring, also because the site has existed since 2015 and I have 6000 links left to correct from semrush. Thanks friends
 
You may replace using SQL query, but please make database backup before.

UPDATE wp_posts SET post_content = REPLACE(post_content,'http://yourdomain.com','https://yourdomain.com')
 
It's already enforced SSL, but the old https remained in http...articles from 2014-15 I mean
I see... so everything works fine.
You just want to make sure all internal links have https. I guess the easiest option would be to run an sql query and replace "http://" with "https://".
 
could also do 301 from http to https so even if the http is there it'll end up on https when user clicks
 
could also do 301 from http to https so even if the http is there it'll end up on https when user clicks
the redirect already exists, the links are working, but semrush still recognizes me as a redirect.

It's another waste of SEO time and energy and I wanted to improve that too ;)
 
Yes, there are techniques for automatically changing all internal links from http to https. If you're using a content management system like WordPress, one option is to use a plugin. The 'Better Search Replace' plugin, which is one of the most popular plugins can help you with this. As, you can replace all instances of http with https in your database, even internal links.

If you're using WordPress, you can also utilize a command line tool called 'WP-CLI'. WP-CLI includes a 'search-replace' command that may be used for substituting all instances of http in your database with https.

If you aren't using a content management system (CMS) like WordPress, you may utilize a search as well as replace tool like 'Notepad++' or 'Sublime Text' to substitute all instances of http with https in your site's files.

Regardless of the approach you use, you should always back up your site before implementing any big changes to your database or files.
 
Back
Top