{"id":19016092,"date":"2026-09-09T23:59:41","date_gmt":"2026-09-09T23:59:41","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/offloader-creating-404s\/"},"modified":"2026-09-10T00:01:27","modified_gmt":"2026-09-10T00:01:27","slug":"offloader-creating-404s","status":"publish","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/offloader-creating-404s\/","title":{"rendered":"Offloader Creating 404s"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">First of all, nice plugin. It&#8217;s worked pretty well in my initial tests. But I&#8217;m running into a few issues&#8230; <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">After offloading all of my media to CloudFlare R2 I ran a crawler and found numerous 404s on the site after offloading. Upon inspection I found that the plugin is rewriting URLs on the website for files that don&#8217;t actually exist on CloudFlare R2. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Upon further troubleshooting I found that this occurs when image derivatives aren&#8217;t registered in the <code>_wp_attachment_metadata<\/code>. Here is an example: <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Original File: <br \/>\/2015\/06\/Example.jpg<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Derivatives: <br \/>\/2015\/06\/Example-300&#215;300.jpg<br \/>\/2015\/06\/Example-800&#215;600.jpg<br \/>\/2015\/06\/Example-1024&#215;768.jpg<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For this example, if the 1024&#215;768 size is not registered in the wp_attachment_metadata, the plugin will not upload the file to CloudFlare R2. But it will still proceed to update the URLs in the post where the &#8216;\/2015\/06\/Example-1024&#215;768.jpg&#8217; was referenced. This results in a 404 now. The physical file exists locally but the plugin doesn&#8217;t upload it to CloudFlare R2 even though it&#8217;s changing the URL in the content. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Since the plugin isn&#8217;t checking rather the image derivatives are uploaded, it&#8217;s creating a lot of problems on the site. Luckily I&#8217;m doing this on a test environment. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This website has been around for a long time and the image size is not currently used by the activated theme. It was most likely something used long ago. It&#8217;s hard to say why the sizes aren&#8217;t registered in the wp_attachment_metadata but they wouldn&#8217;t result in 404&#8217;s if the offloader checked to make sure they existed in R2 before rewriting the URLs. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Ultimately the goal is to remove all locally stored files and store everything in the bucket. So this would also create a bit of a problem with the end goal. I&#8217;m trying to figure out the best options for scenarios like this and rather or not your plugin could work for us. I&#8217;m sure I&#8217;ll run into these same scenarios on many other websites.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">I&#8217;m also running into issues with images that use the GenerateBlocks plugin. These images do seem to get uploaded to CloudFlare R2 but seem to be served locally&#8230; I haven&#8217;t fully had time to troubleshoot this but if you&#8217;re aware of any issues or lack of support your offloader would have with plugins like this, it would be helpful to understand. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Thanks,<br \/>Ben<\/p>\n","protected":false},"template":"","class_list":["post-19016092","topic","type-topic","status-publish","hentry"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/19016092","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":1,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/19016092\/revisions"}],"predecessor-version":[{"id":19016093,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/19016092\/revisions\/19016093"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=19016092"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}