Description
Readers like to know whether an article is still current. DevLab Datemark shows the date a post was last updated, taken from the “modified” date WordPress already keeps for every post. Nothing is written to your posts: the line is added to the page while it is displayed.
What it does
- A shortcode,
[devlab_last_updated], prints the line “Updated on {date}” wherever you put it in a post, a page or a Shortcode block. In a widget it uses the single post or page being viewed, so on the home page and archives it prints nothing unless you addid="123"to point it at one post. - An optional automatic mode adds the same line before or after the content of the content types you choose (posts, pages and other public types except Media).
- The automatic line only appears when the item was edited more than five minutes after it was published, so a brand-new post does not carry a pointless “Updated on” with its own publish date (the five minutes also cover the extra save the block editor makes right after publishing when another plugin adds a meta box).
- You choose the label (the default text follows your site language when a translation is available through WordPress.org), the date format (the one from Settings > General by default), the position and the content types.
- The date uses your site’s time zone and language. The HTML uses the
timeelement with a machine-readabledatetimevalue. - A tiny stylesheet (a few lines, loaded from your own site, only on pages that use the automatic line or the shortcode) is optional. Switch it off to style the line with your theme.
Shortcode attributes (all optional)
label="Last edit:"changes the text of one line.label=""prints only the date.format="d/m/Y"changes the date format of one line.id="123"reads the date of another published post.only_if_updated="yes"prints nothing unless the post was edited more than five minutes after it was published.
What it does not do
- It does not change the modified date. That date is updated by WordPress when you save a post, so please update only when the content really changed, to keep the date honest.
- It does not add structured data (schema) or meta tags. It only prints a visible date on the page.
- The automatic line is not added to feeds, archive lists, excerpts or the REST API. A shortcode you place inside a post is part of that post’s content, so it shows wherever WordPress shows that content.
Light and quiet
The plugin stores its settings in one small option. If you dismiss its notice, it also saves a small flag in your user profile (user meta). It creates no database table, does not touch .htaccess, does not cache anything and does not crawl your site. On your public pages it adds no database query of its own, with two exceptions: the shortcode’s id attribute reads another post, and on a multisite site where the plugin was network-activated and its settings were never saved, reading the settings can take one small query. On a site that only uses the shortcode, nothing is hooked into your content at all.
For developers
CSS classes: devlab-lu, devlab-lu__label, devlab-lu__date, with devlab-lu--before or devlab-lu--after on the automatic line.
Filters:
add_filter( 'devlab_lu_is_updated', function ( $updated, $post, $modified, $published ) { return $updated; }, 10, 4 );
changes the rule that decides whether a post counts as “updated”. For example, return true only when the post was edited more than a day after it was published.
add_filter( 'devlab_lu_html', function ( $html, $post, $timestamp, $args ) { return $html; }, 10, 4 );
changes the HTML of the line. It must return escaped HTML.
Privacy
This plugin collects no visitor data, sends nothing to external services, needs no account or API key and sets no cookies. Its settings screen has two links to the DevLab Store (devlab.ia.br) with utm_ tags that name this plugin (one in the notice, one in the box); your browser contacts that site only if you click one.
About DevLab
DevLab builds plugins and a theme for WordPress. The plugin adds its screen under a DevLab menu, which it creates unless another DevLab plugin already did. That screen has one dismissible notice and a small box, each with a link to the DevLab Store (devlab.ia.br/store), which lists our free and paid plugins and a theme. The plugin adds nothing promotional anywhere else in your dashboard. On your public pages it adds only the “Updated on” line described above and, unless you switch it off, its small stylesheet; it never adds a credit link.
Screenshots



Installation
- Upload the
devlab-datemarkfolder to the/wp-content/plugins/directory, or install the plugin from the Plugins screen in WordPress. - Activate the plugin through the Plugins screen.
- Go to DevLab > Datemark. Either put
[devlab_last_updated]where you want the line, or turn on Add the line to my content automatically, pick the content types and click Save Changes.
FAQ
-
Where do I find the settings?
-
In the WordPress dashboard, under DevLab > Datemark. There is also a Settings link on the Plugins screen.
-
I activated the plugin and nothing appears.
-
The automatic line is off until you turn it on, so the plugin does not change your pages without being asked. Turn on Add the line to my content automatically in the settings, or place the shortcode
[devlab_last_updated]. Remember that the automatic line only shows on items that were edited after they were published. -
Why does the shortcode show a date on a post I never edited?
-
The shortcode always prints a date. For a post that was never edited after it was published, that is the publish date. Use
[devlab_last_updated only_if_updated="yes"]to print nothing in that case. -
Can I show just the date, without the label?
-
Yes. Use
[devlab_last_updated label=""]. For the automatic line, the label is the text you type in the settings. -
How do I change the text, for example to “Last reviewed on”?
-
Type it in the Label field. If you leave the field empty, the default text follows your site language when a translation for it is available through WordPress.org.
-
Which date format can I use?
-
Any PHP date format, for example
F j, Yord/m/Y. Leave the field empty to use the format from Settings > General. -
Why is the date different from the one I expected?
-
The date is the “modified” date that WordPress changes every time you save the post, including small edits and bulk or automatic updates made by other plugins. If a tool updates posts in bulk, the date moves for all of them.
-
Does it change my posts or my modified dates?
-
No. It only reads the dates and prints a line when the page is displayed.
-
Does it work with page builders and the block editor?
-
The shortcode works in the Shortcode block and in any builder element that runs shortcodes. The automatic line is added through the standard WordPress content filter, so it works wherever your theme prints the post content on a single page. A builder or theme that prints the content in its own way may leave it out; use the shortcode there.
-
Why did nothing change on my site after saving?
-
If you use a page cache or a performance plugin, clear its cache after you save the settings.
-
Recent WordPress versions have a “Modified Date” block. Why use this plugin?
-
In a block theme you can add the Date block, set to show the modified date, to your templates. This plugin is for when you want the line without editing templates: it adds a labelled line automatically to the content types you choose, works the same way in classic themes, and offers a shortcode with its own label and date format for each line.
-
What happens when I delete the plugin?
-
The plugin’s option and the “notice dismissed” flag are removed. Your posts and their dates are not touched, because the plugin never changed them.
Reviews
There are no reviews for this plugin.
Contributors & Developers
“DevLab Datemark” is open source software. The following people have contributed to this plugin.
ContributorsTranslate “DevLab Datemark” into your language.
Interested in development?
Browse the code, check out the SVN repository, or subscribe to the development log by RSS.
Changelog
0.1.0
- First public release.
