URLs to images get messed up after migration

I migrated a website from one host to another, and I am having a weird issue I never encountered before. The urls to images in html are fine, but the full path to the image has a broken url, the domain outputs twice.

So here is the code generated for an image:

<img src="subdomain.domain.com/wp-content/uploads/2013/12/aleksandra.jpg" class="attachment-full wp-post-image" alt="aleksandra">

And here is the full path to the image in inspector:

http://subdomain.domain.com/subdomain.domain.com/wp-content/uploads/2013/12/aleksandra.jpg

If you need more info please do not hesitate to ask. Any help is much appreciated.

Thanks

Answers:

Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.

Method 1

Back up your database (this is very very important) and download and install “Velvet Blues Update URLs” plugin. On the settings page enter in the old URL field http://subdomain.domain.com/subdomain.domain.com

Enter in the new URL field the URL of your website. Select all options and click “Update”. Update your permalinks as well.

Method 2

You should use a plugin like WP Migrate DB which enables you to enter the new site address and server path before exporting the database. This does a search find and replace which you may need to do now using a solution like https://interconnectit.com/products/search-and-replace-for-wordpress-databases/

“Velvet Blues Update URLs” plugin is another solution or export your DB again.

Method 3

I figured out the problem, when I was exporting the database using Migrate DB plugin, I didn’t put the http:// before the new domain… so all the internal links were broken.


All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x