• Resolved OgdenNews

    (@ogdennews)


    We are attempting to use a plugin to share content between sites in a multisite. We are testing https://rudrastyh.com/plugins/simple-multisite-crossposting to do so. The plugin works well, except it does not work with WP Offload – which is an absolute must for us. Here is the issue:

    When you add a post to 1 site (primary), you can select from the other network sites (secondary) to push the post to. If you add images to the body of the post on the primary, the WP Offload plugin does it’s thing and offloads the image (we use AWS S3) and then rewrites the URL for the body of the post. As you know – the URL remains as a local URL if you look in the post_content field in the database, and the WP Offload plugin rewrites the URL when the post is displayed on the website and also when you edit the post in the admin.

    When the post information gets copied to a secondary site, the post_content field contains the local URL. However, since there is no reference to this image being moved to S3 in the wp_as3cf_items table of the secondary site – WP Offload does NOT rewrite the URL using the S3 location when the post is displayed or edited through the secondary site.

    We do NOT retain the local copy after it is moved to S3, so the local URL that the secondary site is referencing is no longer valid and shows a broken image.

    The question I have is – is there a function that can be ran on the post_content field when doing a DB query from the primary site that will update the URLs in the post_content? If so – this could be used by the crossposting plugin (either by us editing the plugin or reaching out to the author to include it) when copying information from primary’s wp_posts table to the secondary wp_posts table so that the URLs are already converted to the appropriate S3 location. With the URLs already converted – there would be no more issue with the images due to the secondary site not have a reference in the wp_as3cf_items table.

    Thank you to anyone who can offer any assistance with this!
    Jim

    • This topic was modified 2 years, 9 months ago by OgdenNews.
    • This topic was modified 2 years, 9 months ago by OgdenNews.
Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Support Delicious Brains Support

    (@dbisupport)

    Hi @ogdennews!

    WP Offload Media Support Team here. Thanks for reaching out with your query! We would be happy to assist.

    You may use our filter that can help rewrite any local Media Library URLs to their cloud storage version. More about it here:

    https://deliciousbrains.com/wp-offload-media/doc/filtering-urls-in-custom-content/

    Thread Starter OgdenNews

    (@ogdennews)

    Thank you SOOO very much for this @dbisupport ! This is exactly what I needed. I will reach out to the plugin developer to see if he can incorporate this into this plugin.

    Thanks!
    Jim

    Thread Starter OgdenNews

    (@ogdennews)

    I just wanted to add an update to this thread in case anyone else comes across it running into the same issue attempting to use these two plugins in conjunction. If you are attempting to use https://rudrastyh.com/plugins/simple-multisite-crossposting on your multisite with WP Offload installed – the plugin developer Misha was able to write a simple little add-on plugin to install that will incorporate the as3cf filter provided earlier by Delicious Brains support.

    With the additional add-on installed – post content has the as3cf_filter_post_local_to_provider() filter applied before it is copied to the network site’s DB table, making sure that the image URLs are pointing to your offloaded location instead of the local file. If you contact their support, I’m sure they will be happy to provide this plugin fix for you to utilize.

    Thanks again to Delicious Brains for providing a solution for us to pass on to the developer!

    Plugin Support Delicious Brains Support

    (@dbisupport)

    Hi @ogdennews ,

    We’re always happy to help, thanks for letting us know the issue has been resolved! Thank you as well for sharing the news about the add-on from Simple Multisite Crossposting, that makes our plugin compatible with theirs.

    Hi Guys,

    Yes, in case someone will need it in the future, the add-on is available for download from here https://rudrastyh.com/support/multisite-wp-offload-media

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘update image URLs when querying post_content data from database’ is closed to new replies.