On this page the terms attachment, image and media are used interchangably. Strictly speaking, only media attached to a post can be called an attachment.
Post attachments are automatically broadcasted to the child posts upon publishing / updating. Other media may also be copied at the same time.
- Featured images
- Media references in shortcodes in the post
- Media references in custom fields using various add-ons
How media is handled during a Broadcast
Preparations on the parent blog
When the publish button is pressed, Broadcast will:
- Take a note of all media IDs directly attached to the post.
- Note the featured image ID, if any.
- Examine all gallery shortcodes and all media IDs found within are noted.
- Various add-ons will try to find media IDs in various places, for example:
- The 3rd party add-ons will mostly look in the custom fields.
- All attachments will for image links
- Custom Field Attachments will look in the custom fields.
- Gutenberg Attachments will look in Gutenberg blocks
- Shortcode Attachments will look in the shortcodes in the post content.
Preparations on the child blog
If the child post already exists, Broadcast will delete all attached media. This is to ensure that all media is kept updated on all child blogs. The deletion can be prevented by using the Protect Child Properties or Update Attachments add-ons.
After the attachments are cleared, Broadcast will try to copy all media.
Copying the media
One after one, all attachments are attempted to be copied to the child blog.
Broadcast will first check to see if a media file with the exact same slug already exists on the blog. If so, the admin setting existing attachments dictates the action to take:
- The existing media can be used.
- The existing media can be deleted and recopied (overwrite).
- The name of the media can be modified slightly when being copied (randomize)
- The Update Attachments will overwrite in place, without deleting the existing image
The default is to use the existing media ID.
Using option #2 can result in broken links if other posts reference the same media.
Option #3 will generate very many duplicates.
Each copied media will result in the metadata and thumbnails being regenerated. This usually takes a few seconds per image. To save time and help prevent PHP timeouts, the Duplicate Attachments add-on will directly copy the media without regenerating anything.
Modifying the media IDs
In the case of gallery shortcodes, the contained media IDs are modified to point to the equivalent media on the child post. If you use other shortcodes that contain media IDs, you should have a look at the Shortcode Attachments add-on.
Featured images
A featured image, which WordPress internalls calls a thumbnail, will automatically be copied whether attached to the post or not.
Not currently, no. Are the attachments part of a gallery or a featured image or something?
I am using SiteOrigin Page Builder and when I broadcast pages that are managed with the builder, my images disappear. What’s very strange is that the HTML of page actually changes. So instead of:
I get this, on my child site:
As you can see, the entire ‘src’ attribute disappeared from the ‘img’ tag, therefore nothing is displayed on my child page.
How can I fix this and broadcast images that are within page builder?
Thanks!
It looks like your HTML got stripped out. You should e-mail me your code and a debug dump and we can then see what we can see.
Still not possible due to technical limitations in WordPress: all media on each blogs needs its own ID.
You can try a CDN, that does not store images on disk, such as the WP Offload S3 Lite plugin, which others have successfully tested with Broadcast.
You mean, instead of physically copying the files, they are symlinked and then inserted into the media library?
we’re setting up a Multi-Site on WordPress and we figured out a massive problem with post/featured images.
When we set up a featured image, the main site will show it and all the sub-pages will ignore it on the blog main-page.
The image itself is copied under the “media section”, but isn’t linked with the child post item.
Is there any setting which needs to be enabled?
A lot of posts were already written – sometimes the featured image is linked and now no new post will do that.
Hopefully you can help us!
Best regards,
Stefan
What do you mean by “sub-pages will ignore it on the blog main-page”?
Could you e-mail me a debug dump of the post in question? I’d like to see what broadcast is doing with the images.
Then I’ll forward the dump to you when you’ve provided me a short tutorial :)
Done!
For others wondering, the problem was that the “custom fields” Broadcast checkbox was not checked during broadcasting. Therefore BC ignored the featured image, since it is stored in a custom field.
I don’t need to replicate images on every site, and I’m thinking to couple broadcast to a “shared media library” plugin like this https://it.wordpress.org/plugins/network-shared-media/ (not this, but something similar, there are a lot).
Have you an extension to handle something like this?
Have someone experience on something similar? I’m a developer, it’s not a problem to write some code to make the mix.
There is no elegant solution.
WordPress handles attachments by ID, and since each blog has different IDs for the same images, there will have to be copies of the image on each blog.
The usual solutions are either to get bigger web hosting (there are places that offer 2TB of warm storage for 20e a month), use a CDN offloading plugin (S3 Lite seems to work well) or referring to images statically instead of dynamically using image IDs.
I just recently helped someone cut down on 80% of their site size by putting all broadcasted images onto a shared directory, and the images were then refereced statically.
Did you have any more information about how you achieved your last comment regarding putting all images into a shared directory? I am keen to do something similar.
The person went through their theme and posts, replacing all [gallery] shortcodes and image references using IDs, to static references using the IMG HTML tag. Everything was changed to a relative / complete URL to the image.
It required a lot of work to clean up the theme to not use featured images anymore and to ensure that there were no more IDs used anywhere, but it was worth it for the person, since space was expensive.
For me, I pay 10€ a month for 2TB of image storage, so it’s easiest for me to just use the default WordPress way of handling images.
If this is still unclear, e-mail me and I’ll try to explain further.
How to do what, more exactly?
By default, featured images and images in gallery shortcodes are automatically detected and copied over. Other images, in normal image links or embedded in shortcodes or page builder data require special handling. Exactly what kind of handling is necessary I can say more precisely in your case if you could e-mail me a Broadcast debug text of the post in question.
My e-mail address is visible under the “contact” page in the menu. You can either send me the link to the debug file or as a text. Whichever is easier for you.
Is there a function or something I can update to look at s3 replacing the lookup for the local path?
There are two parts to this answer:
1. If you wish to modify attachment information, hook into the threewp_broadcast_broadcasting_started action, and the $action->broadcasting_data->attachment_data array has the information from all of the found attachments, including URLs and file paths.
2. The CDN Workaround has a “copy remote files” option that will download the images to each child blog and use internal WordPress functions to insert the media during broadcasting.
I hope this answers your question somewhat.
What´s wrong?
I’m very skeptical of anything that says it shares media across the network, due to limitations in WordPress itself: media IDs are assigned on a per-blog basis.
Where can I find this plugin you’re using so that I can test it out for myself?
The plugin looks to modify how WordPress images work completely and it doesn’t follow the standard of requiring media to exist on each blog, with its own ID.
I don’t see how the plugin would work with WordPress, let alone work with Broadcast.
WordPress is, unfortunately, not made to share media, but expected media to exist on the same blog.
What can I do, please?
PHP 7.3.14
WP 5.3.2
Divi/Extra 4.2.2
It sounds like you’re going to need the Divi add-on that prevents exactly that kind of thing.
First, thank you very much for creating an amazing plugin. We’ve purchased a Add-On pack to use some additional features.
We are encountering an issue with posts that contain images from the Media Library. Any broadcasted posts with images are creating new database entries for the same image within the Media Library which makes it appear that there are multiple copies of the same image. If the post is updated, then another database entry is created. Any ideas on what could be happening here?
Difficult to say without a debug text, but my first guess would be your Broadcast image handling settings: if you visit Admin > Broadcast > Settings tab > Misc subtab > Attachment settings, what is the setting? USE EXISTING or CREATE RANDOMIZED?
Is it possible not to use the thumbnail of the featured image in the broadcasted content?
Thank you!
Sure. If you insert the image in a gallery shortcode or as an image. Images should be automatically detected and broadcasted.
How are you inserting the featured image and it isn’t working for you?
There must be a reason for the thumbnail differing from the parent. Different thumbnail sizes in the settings? Thumbnail was generated by a plugin that is no longer active or doesn’t work on child images?
Thank you for this great plugin.
I´m publish and broadcast posts and pages and the content goes ok, but.. won’t show the images, or show a different image.. I believe that the ID is not passed correctly.
I want to know if the Elementor adds works because i´m using Elementor and Jet Engine Crocoblock for the Custom post Types
Thanks
Using the Elementor add-on will definitely solve your image problems! If there’s anything missing afterwards, just e-mail!
I am facing the same problem like Stefan T.
I have a Multi-Site on WordPress and I am using the ACF fields. One of the fields are an image field. The content will be copied to the child and the image will be stored in the media library but the link from the image to the post item is missing.
Is there any setting which needs to be enabled?
All other ACF fields are working perfect and I am very happy with the Broadcast plugin.
I hope you can help me.
Kind Regards
Elke
Are you using normal ACF fields? Check that your Broadcast ACF add-on is active.
If you are using ACF blocks, check that you’ve set up Broadcast Gutenberg Attachments add-on correctly. E-mail me if you have questions.
when I broadcast a page using Divi Builder, the images from the Divi Builder aren’t transferred, the URLs remain from the parent page. Only if the image exists in the child media library, the URL in the image module gets changed. The Divi add-on is installed and activated.
What can I do, please?
The best way to diagnose such problems is to enable Broadcast debug mode, broadcast the post to one blog, and then send me the debug text to read through.
Also, point out which images are incorrect, so I know what to look for.
Thanks,
Aslam
If the images are in “Gutenberg” blocks, then have a look at the Gutenberg Attachments add-on.
Then either the ACF add-on solves this problem or the custom field attachments add-on solves this problem, depending on how the image is stored.
The ACF add-on handles normal, standard fields of all types specified in a field group and attached to a post. But your use case sounds more like the CFA add-on. If you send me a dump (Admin > Broadcast > Maintenance tab > view post info check) of the post and its custom fields, I can perhaps tell you.
https://www.dropbox.com/scl/fi/fow4ynpey13taffir12wg/dump.txt?rlkey=g0t7anssj9mu48435xfgekeqj&dl=0
That definitely looks like the Gutenberg Attachments add-on should have worked.
It’s probably just the add-on not correctly set up. Could you e-mail me and show me how you’ve set up the GA add-on? A screenshot from the overview should suffice.
https://www.dropbox.com/scl/fi/wytfj8tyciat751nafh4u/SCR-20231023-nkp.png?rlkey=8tg5j6alc7ucxjokv85n8alms&dl=0
That’s for an image block, which you are not using. You are using a completely different block.
The correct settings should be: name ct/three-column-cta
and multiple ID: ctas_*_image
Nothing in single ID.
https://www.dropbox.com/scl/fi/tr8xfgzl58ud2970xjva3/SCR-20231023-o2y.png?rlkey=mg03r72i23cfqpjao1ymaiaeb&dl=0
WP Bakery uses the “Visual Composer” editor that, last time I checked, uses shortcodes to display images and galleries.
To handle the shortcodes, you’ll need the Shortcode Attachments add-on.