Why do images and links break?
A link is an address that points to a page or file. If the file moves or the address changes, the link points to nothing. This is called a broken link. Common causes are:
- You moved your site to a new address or a new host.
- You switched from
httptohttps. - You deleted a file from the Media Library.
- Permalinks (the page address style) changed.
- File permissions are wrong, so the server cannot read the file.
Warning: Take a full backup before you change settings or edit the database.
Steps to fix it
- Log in to your WordPress dashboard.
- Go to Settings and then General. Check that WordPress Address (URL) and Site Address (URL) are correct.
- Go to Settings and then Permalinks. Do not change anything. Just click Save Changes. This refreshes the rules for your page addresses.
- Go to Media and then Library. Check that the missing image still exists. If not, upload it again.
- Open the page with the broken image. Click the image, remove it and add it again from the Media Library.
- Clear your cache. A cache is a saved copy of your pages that makes them load faster. An old copy can show old, broken addresses. Clear it in your caching plugin and in your browser.
If the addresses are still old
After a move, your posts may still hold the old address inside them. A plugin such as Better Search Replace can replace the old address with the new one in your database. A database is where WordPress stores all of your content.
- Take a backup of your database.
- Install and activate the plugin from Plugins and then Add New.
- Open it under Tools.
- Type the old address in Search for and the new one in Replace with.
- Select your tables and turn on Run as dry run first to see what would change.
- If the result looks right, turn off the dry run and run it again.
Check file permissions
Use the File Manager in your hosting control panel. Folders are normally set to 755 and files to 644. These numbers say who can read or change a file.
Tip: Ask Hostvento support if you are unsure. Open a support ticket any time.
Quick recap
- Broken links usually come from moves, https changes or deleted files.
- Check your site address and save the permalinks again.
- Re-upload missing images and clear your cache.
- Use a search and replace plugin for old addresses, after a backup.