mailerpress icon black white

Documentation

How to Display Your Sent Newsletters with the Campaign Archive Shortcode

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

SettingDescriptionExample
yearFilter campaigns by a specific year. Leave empty to show all years.year="2025"
limitMaximum number of campaigns to display. Use -1 to show all campaigns (default).limit="10"
orderSort 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 ClassElement
.mp-archive-listThe <ul> container for the campaign list
.mp-archive-itemEach <li> campaign entry
.mp-archive-linkThe <a> link wrapping each campaign
.mp-archive-nameThe <span> containing the campaign name
.mp-archive-dateThe <span> containing the send date
.mp-archive-emptyThe <p> shown when no campaigns are found

Important

  • Only campaigns with “sent” status are displayed. Drafts and scheduled campaigns are not included.
  • The order parameter only accepts ASC or DESC. Any other value defaults to DESC.
  • The year parameter 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.