WordPress 7.2 adds a new “On This Day” section to the Activity widget on the dashboard. On the anniversary of posts you’ve published in previous years, it lists them under the heading “Published On This Day”. It’s turned on for every site, and there’s no setting to turn it off, but hiding it only takes a few lines of code.
In this tutorial, we’ll take a look at what the section shows and how to hide it. I’ve tested the code with the WordPress 7.2 beta, which is scheduled for release in early December.
What “On This Day” shows
The Activity widget has listed your scheduled and recently published posts since WordPress 3.8, back in 2013. In WordPress 7.2, it also gets a section with posts published on today’s date in previous years. If you published a post on December 12, 2013, to celebrate the release of WordPress 3.8, it shows up in the widget every December 12.

A few details about how it works:
- It shows up to ten posts, newest first.
- It only includes posts. Pages and custom post types aren’t included.
- When there are no posts from today’s date, the section isn’t shown at all.
The feature has taken a winding road to get here. It was first added to WordPress 7.1 as a separate dashboard widget, but was pulled a few weeks before the release, pending design improvements. For 7.2, it was rebuilt as a section of the Activity widget instead, and recent comments were moved to a widget of their own to make room. If you want a peek behind the curtain, you can follow the whole discussion in the Trac ticket.
Why you might want to hide it
I think “On This Day” is a fun feature. It can highlight posts you might have forgotten about, and subjects you might want to revisit from previous years. But there are a few cases where you might rather not have it:
- You manage sites for clients. A new section showing up on the dashboard after an update can prompt questions, and on a site where old posts were written by people who have since left, it can be more confusing than charming.
- You have old content you’d rather not be reminded of. If you wrote a heartfelt post about a breakup ten years ago, you might not want to be reminded of it on the same date every year. I get this with old photographs on the Apple TV screensaver.
- You have a large site. The section runs an extra database query every time someone opens the dashboard. It matches posts by month and day, which the database can’t look up with an index, so on days with few anniversary posts, it has to check every post you’ve published. On a blog with a few hundred posts, you won’t notice. On a site with tens or hundreds of thousands of posts, it adds load to every dashboard visit, especially if your host doesn’t provide a persistent object cache.
- You simply don’t want it. Which is a perfectly good reason too.
Why not just hide the widget?
The quickest way to get rid of “On This Day” is to hide the whole Activity widget: click “Screen Options” at the top of the dashboard and uncheck “Activity”. But that takes your scheduled and recently published posts with it, and since the setting is saved for each user, everyone else who logs in still sees the section. Your recent comments are safe, at least – in WordPress 7.2, they have a widget of their own.
You could hide just the section with CSS instead, which keeps the rest of the widget and works for every user. But it’s a hack, and it shares a problem with the Screen Options approach: both only hide things visually. Even when a widget is unchecked, WordPress still builds it, so the query still runs on every dashboard load, and you keep the performance cost.
Never hide what you can remove.
How to hide “On This Day”
Instead, we’ll use a new filter for the query that fetches the section’s posts: wp_dashboard_on_this_day_query_args. If the query doesn’t find any posts, WordPress doesn’t output the section at all. The best place for the code is a must-use plugin, so it keeps working whichever theme you use, and can’t be deactivated by accident.
- Connect to your site with SFTP or your host’s file manager, and go to the
wp-contentfolder. - Create a folder called
mu-plugins, if there isn’t one there already. - In it, create a file called
hide-on-this-day.php, and paste this code into it:
<?php/** * Plugin Name: Hide On This Day * Description: Hides the On This Day section of the Activity dashboard widget. *//** * Makes the On This Day query return no posts. * * @param array $args WP_Query arguments for the On This Day section. * @return array Modified arguments. */function my_hide_on_this_day( $args ) { $args['post__in'] = array( 0 ); return $args;}add_filter( 'wp_dashboard_on_this_day_query_args', 'my_hide_on_this_day' );
The code limits the query to a post with the ID 0, which doesn’t exist, so the query never finds anything. Reload the dashboard, and the section is gone. Since the section gets its posts from a WP_Query like any other, the same filter can be used to change what it shows instead of hiding it. You can include more posts, a different post type, or anything else WP_Query supports.
You can also add the code to a regular plugin, or to your theme’s functions.php file. Just keep in mind that “On This Day” comes back if you deactivate the plugin or switch themes.
WordPress 7.2 is still in development, and some of the finer details above might change before the planned release in early December. I’ll update the tutorial once it’s out.


