Hot answers tagged

1

The GUID is not the image's URL. It typically does end up (coincidentally) being the original URL of the image, because it needs to be a unique identifier - but that's all WordPress uses it for, as a unique identifier. Your code should successfully update the URLs of the featured images of posts, but only the featured images. It sounds like you are probably ...


1

The WordPress uploads directory's path and URL are determined by the wp_upload_dir() function which applies a filter named upload_dir which you can use to fix the double slashes in the attachment URL. So if you turned off the "Organize my uploads into month- and year-based folders" setting, try the following: add_filter( 'upload_dir', function ( $data ) { ...


Only top voted, non community-wiki answers of a minimum length are eligible