Requirements
The [mailerpress_archive] shortcode allows you to display a list of all your sent campaigns directly on any page or post of your WordPress site. This is useful to create a public newsletter archive page where your visitors can browse and read past emails.
The shortcode works with any WordPress page builder, the Block Editor, or directly in PHP templates.
Quick Setup
Simply add the following shortcode to any page or post:
[mailerpress_archive]
This will display all your sent campaigns, ordered by date (newest first).
Settings
| Setting | Description | Example |
|---|---|---|
year | Filter campaigns by a specific year. Leave empty to show all years. | year="2025" |
limit | Maximum number of campaigns to display. Use -1 to show all campaigns (default). | limit="10" |
order | Sort order by date. DESC for newest first (default), ASC for oldest first. | order="ASC" |
Common Examples
Display all sent campaigns (default)
[mailerpress_archive]
Display only campaigns from 2025
[mailerpress_archive year="2025"]
Display the 5 most recent campaigns
[mailerpress_archive limit="5"]
Display the 10 oldest campaigns first
[mailerpress_archive limit="10" order="ASC"]
Display all campaigns from 2024, oldest first
[mailerpress_archive year="2024" order="ASC"]
Embedding in PHP
You can also use the shortcode directly in your PHP theme templates:
echo do_shortcode('[mailerpress_archive limit="10"]');
Or with multiple parameters:
echo do_shortcode('[mailerpress_archive year="2025" limit="5" order="DESC"]');
Output
The shortcode renders a clean, styled list where each item displays:
- Campaign name (linked to the public email view, opens in a new tab)
- Send date (formatted according to your WordPress date settings)
If no sent campaigns are found, a message “No campaigns found.” is displayed.
CSS Classes
The shortcode outputs minimal, clean styling. You can customize the appearance using the following CSS classes:
| CSS Class | Element |
|---|---|
.mp-archive-list | The <ul> container for the campaign list |
.mp-archive-item | Each <li> campaign entry |
.mp-archive-link | The <a> link wrapping each campaign |
.mp-archive-name | The <span> containing the campaign name |
.mp-archive-date | The <span> containing the send date |
.mp-archive-empty | The <p> shown when no campaigns are found |
Important
- Only campaigns with “sent” status are displayed. Drafts and scheduled campaigns are not included.
- The
orderparameter only acceptsASCorDESC. Any other value defaults toDESC. - The
yearparameter must be a numeric value (e.g.,2025). - Campaign links open in a new browser tab.
- The date format follows your WordPress Settings > General > Date Format configuration.