- This topic has 5 replies, 3 voices, and was last updated 2 months, 1 week ago by Leo.
November 9, 2021 at 11:37 am #1997713Michael
I am in the process of revamping a website. For some reason when I migrated the site to a staging site on WP-engine, it created links for some of the existing images that are pointing to an old url: http://joansbolton.files.wordpress.com
Here is one of the blog entries on the current site:
And here is the code for one of the images (first image with a caption on the right):
<div id="attachment_859" style="width: 183px" class="wp-caption alignright"><img aria-describedby="caption-attachment-859" loading="lazy" src="http://joansbolton.files.wordpress.com/2010/10/dscf00011.jpg?w=173" alt="" title="DSCF0001" width="173" height="115" class="size-thumbnail wp-image-859" srcset="https://santabarbaragardens.com/wp/wp-content/uploads/2010/10/dscf00011.jpg 432w, https://santabarbaragardens.com/wp/wp-content/uploads/2010/10/dscf00011-300x200.jpg 300w" sizes="(max-width: 173px) 100vw, 173px" /></a>
These images do not have a hyperlink that takes you away from the page.
Here is that same blog entry on the staging site:
You can see that same image now has a hyperlink:
Here the code for that:
<figure id="attachment_859" aria-describedby="caption-attachment-859" style="width: 163px" class="wp-caption alignright"><a href="http://joansbolton.wordpress.com/2010/10/05/fall-planting-winter-vegetables/dscf0001-2/" rel="attachment wp-att-859"><img loading="lazy" src="http://joansbolton.files.wordpress.com/2010/10/dscf00011.jpg?w=173" alt="" title="DSCF0001" class="size-thumbnail wp-image-859" width="173" height="115"></a>
That link points to an old site that DOES take you to the old site which we don’t want.
There are 82 instances of that url in the database. Is there a way to remove those links in the staging site?
I did find this article:
https://www.wpbeginner.com/wp-tutorials/how-to-disable-image-attachment-pages-in-wordpress/November 9, 2021 at 11:46 am #1997726LeoStaffCustomer Support
This isn’t something the theme can control or interfere with.
The WPBeginner article you found looks promising. Have you tried it?
Or maybe a plugin like this would work?
You can also check with your hosting support to see if they have any suggestions.November 9, 2021 at 2:18 pm #1997862Longinos
Michael and Leo, excuse me…
The article is about media attachment pages, not about post content.
Media attachment pages are created by wordpress with data you can edit in the media library.
To delete o change the url in the post content you need:
A) Work whit the database and sql or
B) A plugin to search text in database fields and delete o change it.
C) Use phpAdmin
But take care on this work: Make a database backup before.November 9, 2021 at 3:02 pm #1997893LeoStaffCustomer SupportNovember 9, 2021 at 3:03 pm #1997894Michael
Thank you both.November 9, 2021 at 6:43 pm #1998006
- You must be logged in to reply to this topic.