How do I add images to my MPG generated pages?
MPG allows you to add images dynamically to your generated pages using data from your source file. Images can be loaded from two different sources.
In this article
📝 Note: Adding images to your generated pages works in both the free and Pro versions of MPG. To learn more about the plugin, see the MPG documentation.
Option A: Images hosted in the WordPress Media Library (recommended)
If your images are uploaded to Media → Library, the value stored in your MPG source file must match the image filename used by WordPress, or be the full Media Library URL.
Example Media Library URL:
https://example.com/wp-content/uploads/2024/07/tokyo.jpegValid source file values:
tokyo.jpeg⚠️ Important: MPG does not upload or fetch images automatically. The image file must already exist in your Media Library, and the filename (including the extension) must match exactly.
Option B: External image URLs
You can also use images hosted externally (for example, CDN links or placeholder services like Picsum).
Example database value:
https://picsum.photos/600/400📝 Note: External images must be publicly accessible and allow hotlinking. If an external image does not load, switch to Media Library images instead.
Add images to your template page
The following steps cover images stored in your WordPress Media Library. For an external image, add its full URL to the source file and use the full-URL example in step 6; skip the upload and URL-copy steps.
Add the image filename to your source file if it is in the Media Library, or add the full image URL if it is hosted externally.

Upload images to your WordPress Media Library folder.

Click your image to read its full path. Use this URL to identify the Media Library base path for the template; keep only the filename in your source file.

Go to the template page where you want to display images and add an image block.
Click the three dots button and select Edit as HTML.

Replace the filename in the image source with the MPG image shortcode from your source file. Use the full Media Library path before the shortcode when the source contains filenames, or use the shortcode alone when the source contains full image URLs.
Example using a Media Library filename:
<img src="https://example.com/wp-content/uploads/2024/07/{{mpg_city_img}}">Example using a full image URL:
<img src="{{mpg_city_img}}" alt="Dynamic image">
Result

📝 Note: You can add any img HTML parameters such as alt or class, or use the Picsum random image generator if you don't have actual pictures.
If a page builder's image field doesn't accept placeholders
Avada supports a Dataset Column dynamic-data source for supported image and background fields:
Open the page selected as your MPG project's template in Avada Builder.
Open the image or background field's Dynamic Data picker and choose Multiple Pages Generator → Dataset Column.


Select your image URL column in Column, save the template, and check a generated page.
This source is available when editing an MPG template, not an ordinary post. Builder previews use the first dataset row; each generated page uses its own row.
For fields without this dynamic source, MPG can replace a placeholder only if its text is saved in the template. Use the HTML/CSS fallbacks below and leave the native image or background selector empty when using those fallbacks.
Dynamic background image in an Avada container (fallback)
Edit the container and open its custom HTML attribute settings.
Add an attribute named
style.Enter the following as the attribute value:
cssbackground-image:url('{{mpg_hero_image}}');background-size:cover;background-position:center;
mpg_hero_image is an example — replace it with the placeholder generated from your own image URL column. Keep Avada's own background image selector empty.
Dynamic regular image in Avada (fallback)
Instead of Avada's native Image element, add the element that renders custom HTML/code, and insert:
<img src="{{mpg_card_image}}" alt="{{mpg_card_image_alt}}">Both placeholders are examples — replace them with the placeholders generated from your own source columns. Make sure the option that allows the code element to render its HTML is enabled in Avada's settings.
💡 Tip: If your page builder or theme can use the WordPress featured image dynamically (for example, Elementor can pull the featured image as a dynamic background), you can set a featured image from your source file instead. See How to set featured image for generated posts.
Troubleshooting
If the image does not appear on generated pages, make sure that:
- The image exists in Media → Library.
- The filename in the database matches exactly.
- The image URL opens directly in the browser.
- There are no extra spaces in the database cell.
- The image is publicly accessible.
- In Avada, try Dataset Column in the field's Dynamic Data picker first. If the field does not support it, use the HTML/CSS fallbacks above. Do not edit the builder's generated shortcode by hand, because that can damage the saved layout.
Video - How to add images to MPG pages?
For further help, watch this short tutorial video on how to add images to multiple pages in bulk:
