Title: Years Ago Today
Author: Scott Reilly
Published: <strong>July 8, 2015</strong>
Last modified: June 5, 2026

---

Search plugins

![](https://ps.w.org/years-ago-today/assets/banner-772x250.png?rev=1194581)

![](https://ps.w.org/years-ago-today/assets/icon-128x128.png?rev=1194581)

# Years Ago Today

 By [Scott Reilly](https://profiles.wordpress.org/coffee2code/)

[Download](https://downloads.wordpress.org/plugin/years-ago-today.2.0.zip)

 * [Details](https://wordpress.org/plugins/years-ago-today/#description)
 * [Reviews](https://wordpress.org/plugins/years-ago-today/#reviews)
 *  [Installation](https://wordpress.org/plugins/years-ago-today/#installation)
 * [Development](https://wordpress.org/plugins/years-ago-today/#developers)

 [Support](https://wordpress.org/support/plugin/years-ago-today/)

## Description

This plugin provides a simply admin dashboard widget that lists all of the posts
published to your site on this day in previous years. The same listing can be shown
on the front-end via the “Years Ago Today” block (WordPress 7.0+) or the `[years-
ago-today]` shortcode. Users have the option (via their profiles) to opt into receiving
a daily email that provides a listing and links to all of the posts published to
your site on this day in previous years.

Links: [Plugin Homepage](https://coffee2code.com/wp-plugins/years-ago-today/) | 
[Plugin Directory Page](https://wordpress.org/plugins/years-ago-today/) | [GitHub](https://github.com/coffee2code/years-ago-today/)
| [Author Homepage](https://coffee2code.com/)

### Developer Documentation

Developer documentation can be found in [DEVELOPER-DOCS.md](https://github.com/coffee2code/years-ago-today/blob/master/DEVELOPER-DOCS.md).
That documentation covers the numerous hooks provided by the plugin. Those hooks
are listed below to provide an overview of what’s available.

 * `c2c_years_ago_today-email_cron_time` : Customize the time of day to email the
   Years Ago Today email to those who have opted-in to it. By default this is “9:
   00 am”.
 * `c2c_years_ago_today-email-if-no-posts` : Override whether the daily Years Ago
   Today email is sent out on days that don’t have any posts in prior years. By 
   default this value is false, meaning no email is sent in such circumstances.
 * `c2c_years_ago_today-email-body-no-posts` : Customize the content of the body
   of the daily Years Ago Today email when it is sent on days that had no posts 
   in prior years.
 * `c2c_years_ago_today-first_published_year` : Explicitly define the earliest year
   to be considered when finding earlier published posts.
 * `c2c_years_ago_today-post_types` : Customize the post types included for consideration.
   Default `['post']`.
 * `c2c_years_ago_today-batch_size` : Customize the number of daily emails sent 
   per batch. Default 40.
 * `c2c_years_ago_today-to_address` : Customize the email address specified for 
   the “To:” field of batched emails. Default “noreply@{site-domain}”.

## Screenshots

[⌊The admin dashboard showing posts published on the current day in previous years.⌉⌊
The admin dashboard showing posts published on the current day in previous years
.⌉[

The admin dashboard showing posts published on the current day in previous years.

[⌊The admin dashboard when no posts were published on the current day in any previous
year.⌉⌊The admin dashboard when no posts were published on the current day in any
previous year.⌉[

The admin dashboard when no posts were published on the current day in any previous
year.

[⌊Profile option for opting into receiving a daily email of posts published on the
current day in previous years. Also shown are links for previewing each style of
email.⌉⌊Profile option for opting into receiving a daily email of posts published
on the current day in previous years. Also shown are links for previewing each style
of email.⌉[

Profile option for opting into receiving a daily email of posts published on the
current day in previous years. Also shown are links for previewing each style of
email.

[⌊Preview of the HTML email with the default basic listing of posts by year.⌉⌊Preview
of the HTML email with the default basic listing of posts by year.⌉[

Preview of the HTML email with the default basic listing of posts by year.

[⌊Preview of the HTML email, but with full post content included.⌉⌊Preview of the
HTML email, but with full post content included.⌉[

Preview of the HTML email, but with full post content included.

[⌊Preview of the plain text email.⌉⌊Preview of the plain text email.⌉[

Preview of the plain text email.

## Blocks

This plugin provides 1 block.

 *   Years Ago Today

## Installation

 1. Install via the built-in WordPress plugin installer. Or download and unzip `years-
    ago-today.zip` inside the plugins directory for your site (typically `wp-content/
    plugins/`)
 2. Activate the plugin through the ‘Plugins’ admin menu in WordPress
 3. View the widget on your admin dashboard.
 4. (Optional.) To show the same listing on the front-end, insert the “Years Ago Today”
    block (WordPress 7.0+) or add the `[years-ago-today]` shortcode to a post or page.
    Both output a title which can be overridden or omitted.
 5. (Optional.) To sign up for a daily email that lists posts published that day, go
    to your profile, set the checkbox for ‘”Years Ago Today” email’, choose the style
    of email you wish to receive, and then press the “Update Profile” button to update
    your profile.

## FAQ

### If multiple posts were made on this day in a past year, will they be listed?

Yes.

### Are posts published today included?

No, only posts made for any year before the current year.

### Can I filter the widget to only show my posts (or only posts for a particular author)?

Not yet. This functionality is expected in a future update.

### Why is the checkbox for ‘”Years Ago Today” email’ in my profile disabled?

Your site has its cron system disabled (via the `DISABLE_WP_CRON` constant) which
means scheduled events (such as this plugin’s daily emails) won’t be handled by 
WordPress.

### I opted into the daily email, but why haven’t I gotten it?

The cron system for WordPress (which handles scheduled events, such as the schedule
daily email) requires site traffic to trigger close to its scheduled time, so low
traffic sites may not see events fire at a consistent time. It’s also possible cron
has been disabled by the site (see previous question).

### Is this plugin compatible with multisite?

Yes.

### Does this plugin include unit tests?

Yes. The tests are not packaged in the release .zip file or included in plugins.
svn.wordpress.org, but can be found in the [plugin’s GitHub repository](https://github.com/coffee2code/years-ago-today/).

## Reviews

![](https://secure.gravatar.com/avatar/64b066d7d028aee5b7344fdd17060e302f7719e758ca5c9eb6e08ea292877605?
s=60&d=retro&r=g)

### 󠀁[Very useful tool for sporting events](https://wordpress.org/support/topic/very-useful-tool-for-sporting-events/)󠁿

 [emilegutenkauf](https://profiles.wordpress.org/emilegutenkauf/) April 10, 2025

Very useful tool for sporting events that take place every year. It would be even
more useful if you could set a range of +/- a few days before or after as events
always take place one day before or earlier in the coming years. This could be arranged
by a simple way like an arrow back or an arrow forward. Is that an idea?

![](https://secure.gravatar.com/avatar/efa99c692286ca77dc98695c5b1d48861698b485e025f1087f4695cd4f6c74ff?
s=60&d=retro&r=g)

### 󠀁[Very useful plugin.](https://wordpress.org/support/topic/very-useful-plugin-869/)󠁿

 [bejiitas_wrath](https://profiles.wordpress.org/bejiitas_wrath/) November 14, 2019
1 reply

This is a very useful plugin, but after the latest update, it shows all of my posts,
instead of just the ones posted on the day. But this is very good for me. I can 
check on posts in the past and then see if they need updating or editing. Thank 
you for this.

![](https://secure.gravatar.com/avatar/435fa69c397e645f4ed11680580115ae902cb649da00b2184c5cc435209f5304?
s=60&d=retro&r=g)

### 󠀁[Really enjoy it](https://wordpress.org/support/topic/really-enjoy-it/)󠁿

 [setevoy](https://profiles.wordpress.org/setevoy/) March 25, 2019

Simple for use and absolutely useful plugin. Just one thing already mentioned here–
will be great to have a widget available. Anyway – 5 stars are yours, thanks for
your job.

![](https://secure.gravatar.com/avatar/f9632265c4c6cace40672b13eadb12b909f34e6015bf83746b902e714fdbc721?
s=60&d=retro&r=g)

### 󠀁[Great little plugin, needs a widget!](https://wordpress.org/support/topic/great-little-plugin-needs-a-widget/)󠁿

 [Julius E](https://profiles.wordpress.org/julius-e/) March 25, 2019

I was looking for something like this for months when I came across it by accident
on an unrelated plugin review article. Does exactly what it says and if you’ve go
2000+ posts like me, it helps you remember older posts that you can repost as evergreen
content. I agree that it definitely needs a front-end widget which would be incredibly
useful if, like me, you would like to have an ‘on this day’ feature displaying content
from your own site.

![](https://secure.gravatar.com/avatar/1bf3b6fb9f211c1d6b224f2678c61da12c18b7512fdc5c0102fbda319c4538d5?
s=60&d=retro&r=g)

### 󠀁[Exactly what I was looking for](https://wordpress.org/support/topic/exactly-what-i-was-looking-for-377/)󠁿

 [osti47](https://profiles.wordpress.org/osti47/) February 7, 2019

almost thought I had to code something myself, when I found this. Thanks alot!

![](https://secure.gravatar.com/avatar/76531533d4ec8ef6b40757c24312a15f261e972240a60da68e254d4cd80d2e34?
s=60&d=retro&r=g)

### 󠀁[This is actually very nice](https://wordpress.org/support/topic/this-is-actually-very-nice/)󠁿

 [Dominik Schwind](https://profiles.wordpress.org/dominikschwind-1/) January 8, 
2019

It’s basically Timehop for your own blog, a nice little dose of daily nostalgia.

 [ Read all 6 reviews ](https://wordpress.org/support/plugin/years-ago-today/reviews/)

## Contributors & Developers

“Years Ago Today” is open source software. The following people have contributed
to this plugin.

Contributors

 *   [ Scott Reilly ](https://profiles.wordpress.org/coffee2code/)
 *   [ Audrey Capital ](https://profiles.wordpress.org/audrey/)

[Translate “Years Ago Today” into your language.](https://translate.wordpress.org/projects/wp-plugins/years-ago-today)

### Interested in development?

[Browse the code](https://plugins.trac.wordpress.org/browser/years-ago-today/), 
check out the [SVN repository](https://plugins.svn.wordpress.org/years-ago-today/),
or subscribe to the [development log](https://plugins.trac.wordpress.org/log/years-ago-today/)
by [RSS](https://plugins.trac.wordpress.org/log/years-ago-today/?limit=100&mode=stop_on_copy&format=rss).

## Changelog

#### 2.0 (2026-06-04)

Highlights:

This recommended release adds a block, adds a shortcode, adds an email previewer,
adds support for additional post types via filter, improves performance and sending
of emails, prevents translations from containing unintended markup, notes compatibility
through WP 7.0+ and PHP 8.5+, drops compatibility with versions of WP older than
5.6, and much more.

Details:

 * New: Add front-end block and `[years-ago-today]` shortcode to display the same
   listing as the admin dashboard widget
    - New: Add `get_widget_markup()` and `get_widget_inner_markup()` to centralize
      listing markup generation
    - New: Register PHP-only block `coffee2code/years-ago-today` on WordPress 7.0
      +
    - New: Add public CSS for block and shortcode output
 * New: Send full HTML of posts in the email alongside plain text version. Fixes#
   5. Props akirk.
    - New: Extract HTML email generation logic out from `get_email_body()` into 
      new `get_html_email()`
    - New: Add `get_html_email_template()` to return the template used for HTML 
      emails, with placeholders for subject, body, and footer
    - New: Add `get_resized_content()` to rewrite image tags in post content to 
      use smaller-sized versions
    - New: Add `get_html_email_image_size()` to get image size used in HTML emails
    - New: Add filter ‘c2c_years_ago_today-html_email_image_size’ to customize image
      size used in HTML emails
    - Change: Move amending of footer into `get_email_body()` and add optional arg
      to disable that behavior
 * New: Add email previewer to preview variations of both plain text and HTML emails
 * New: Add support for including additional post types via new ‘c2c_years_ago_today-
   post_types’ filter
 * Change: Add date to email subject
 * Change: Add optional `$include_year` argument to `get_formatted_date_string()`,
   allowing for full date with year
 * Fix: Restore proper registration of activation/deactivation hooks. Fixes #4. 
   Props akirk.
 * Fix: Ensure timing of emails is consistent with site’s timezone rather than the
   server’s
 * Change: Improve performance of `get_posts()`
    - Change: Cache post IDs and only query for IDs when more is needed
    - New: Add `clear_transient_on_publish()`, `get_post_ids_cache_key()`, and `
      query_post_ids()`
    - New: Hook ‘save_post’ to clear transient when backporting a post to the current
      day in any past year
 * Change: Improve the sending of emails
    - Change: Group users together (via BCC:) and email them in batches rather than
      individually when sending to multiple users
    - New: Add `get_bcc_batch_size()` to get number of people to email per BCC: 
      batch
    - New: Add filter ‘c2c_years_ago_today-batch_size’ to customize the number of
      people to email per BCC: batch
    - New: Add `get_bcc_to_email_address()` to get the ‘To:’ email address used 
      for Bcc-batched emails
    - New: Add filter ‘c2c_years_ago_today-to_address’ to customize the ‘To:’ email
      address used for Bcc-batched emails
    - New: Extract email handling logic out from `cron_email()` into new `send_email_of_type()`
    - New: Extract email address grouping logic out from `cron_email()` into new`
      get_users_to_email_grouped_by_content_type()`
 * Change: Output full month instead of 3-letter abbreviations
 * Change: Revamp dashboard output, more semantically putting each year within `
   section` tags
 * Change: Align `get_first_published_year()` query with `get_posts()`
 * Change: Incorporate a hash of post types into the first published year cache 
   key
 * Fix: Properly clear the first published year cache entry on deactivation by using
   the correct cache key
 * Change: Ensure list bullets are consistently visible in all dark mode schemes
 * New: Add descriptive help text to profile setting for accessibility and clarity
 * New: Enqueue JS on profile pages
 * New: Enqueue separate admin CSS file rather than outputting into `head`
 * Change: Also enqueue CSS on profile pages
 * Change: Change caching to support multisite usage
 * Hardening: Prevent translated and generated strings from containing unintended
   markup
 * Hardening: Prevent PHP warnings from any potential malicious form submission 
   field value
 * Change: Update plugin description
 * Change: Use consistent phrasing across UI and documentation
 * Change: Rename `add_user_email_footer()` to `get_email_footer()` and remove arguments
   and just return the footer based on a format (‘text’ or ‘html’)
 * Change: Add context to translation of dashboard widget title to differentiate
   it from plugin’s name
 * Change: Allow year headings in plain text emails to be translated
 * Change: Remove `is_admin()` guard from `init()`, which isn’t strictly necessary
   and impedes unit tests
 * Change: Update uses of `current_time()` and `mysql2date()` to more modern `wp_date()`
 * New: Add `get_optin_label()` to centralize the optin label since it is used in
   two places
 * Change: Discontinue use of HEREDOC syntax
 * Change: Discontinue unnecessary explicit loading of textdomain
 * Change: Add missing translator comments for strings with one placeholder
 * Change: Prevent unwarranted PHPCS complaints
 * Fix: Fix translator string that referenced an extraneous placeholder
 * Change: Note compatibility through WP 7.0+
 * Change: Drop compatibilities with versions of WP older than 5.6
 * Change: Note compatibility through PHP 8.5+
 * Change: Update copyright date (2026)
 * Change: Add new screenshots and update existing screenshots

#### 1.6 (2024-08-09)

 * Fix: Convert use of deprecated string interpolation syntax to prevent notice 
   under PHP8.2. Props Simounet.
 * Change: Note compatibility through WP 6.6+
 * Change: Update copyright date (2024)
 * New: Add `.gitignore` file
 * Change: Remove development and testing-related files from release packaging
 * Unit tests:
    - Hardening: Prevent direct web access to `bootstrap.php`
    - Allow tests to run against current versions of WordPress
    - New: Add `composer.json` for PHPUnit Polyfill dependency
    - Change: In bootstrap, store path to plugin file in a constant
    - Change: In bootstrap, add backcompat for PHPUnit pre-v6.0

#### 1.5.1 (2023-06-11)

 * Change: Note compatibility through WP 6.3+
 * Change: Update copyright date (2023)
 * New: Add link to DEVELOPER-DOCS.md in README.md

_Full changelog is available in [CHANGELOG.md](https://github.com/coffee2code/years-ago-today/blob/master/CHANGELOG.md)._

## Community plugin

This plugin is developed and supported by a community.

## Meta

 *  Version **2.0**
 *  Last updated **2 months ago**
 *  Active installations **100+**
 *  WordPress version ** 5.6 or higher **
 *  Tested up to **7.0.2**
 * Tags
 * [admin](https://wordpress.org/plugins/tags/admin/)[coffee2code](https://wordpress.org/plugins/tags/coffee2code/)
   [dashboard](https://wordpress.org/plugins/tags/dashboard/)[history](https://wordpress.org/plugins/tags/history/)
   [on this day](https://wordpress.org/plugins/tags/on-this-day/)
 *  [Advanced View](https://wordpress.org/plugins/years-ago-today/advanced/)

## Ratings

 5 out of 5 stars.

 *  [  6 5-star reviews     ](https://wordpress.org/support/plugin/years-ago-today/reviews/?filter=5)
 *  [  0 4-star reviews     ](https://wordpress.org/support/plugin/years-ago-today/reviews/?filter=4)
 *  [  0 3-star reviews     ](https://wordpress.org/support/plugin/years-ago-today/reviews/?filter=3)
 *  [  0 2-star reviews     ](https://wordpress.org/support/plugin/years-ago-today/reviews/?filter=2)
 *  [  0 1-star reviews     ](https://wordpress.org/support/plugin/years-ago-today/reviews/?filter=1)

[Your review](https://wordpress.org/support/plugin/years-ago-today/reviews/#new-post)

[See all reviews](https://wordpress.org/support/plugin/years-ago-today/reviews/)

## Contributors

 *   [ Scott Reilly ](https://profiles.wordpress.org/coffee2code/)
 *   [ Audrey Capital ](https://profiles.wordpress.org/audrey/)

## Support

Got something to say? Need help?

 [View support forum](https://wordpress.org/support/plugin/years-ago-today/)

## Donate

Would you like to support the advancement of this plugin?

 [ Donate to this plugin ](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=6ARCFJ9TX3522)