[ad_1]
Is there a plugin or some other way where I can have it automatically add a “WARNING: this is an old post” to any post that’s been published more than X months ago? (for instance every post published more than 6 months ago, and it automatically adds to new posts as soon as it reaches the threshold)
[ad_2]
<?php if( strtotime( $post->post_date ) < strtotime(‘-1 years’) ) {
echo ‘old posts’;
} else {
echo ‘new posts’;
}; ?>
You can use automation to check your posts, it depends on how many posts you have, if it’s tend of thousands you may need to do this in batches.
Basically something like n8n.io (both free and cloud versions) will allow you to periodically scan your posts and you can check the date, so every Sunday or something, it can go through the posts and then add the tag or some custom taxonomy.
After you’ve run it once, you can reduce the automation load by having it check only the last week, or you can do that daily once you’ve done the first run.
There are automation plugins like Uncanny Automator, but I don’t know if they’ll do that.
Some people may tell you to setup a CRON, but that may be a bit too complex if you’re not technical, and as n8n.ionhas a free option it could be exactly what you need.
As for the tags you can use Advanced Custom Fields, but that might need a custom API call so probably best to try and use WordPress’ built in tagging.