This is a very simple query of the $wpdb->posts
table.
$last_update = $wpdb->get_var("
SELECT post_date
FROM {$wpdb->posts}
WHERE post_type IN('post','page')
AND post_status="publish"
ORDER BY post_date DESC LIMIT 1"
);
var_dump($last_update);
You could do the same thing (similar) with …
$args = array(
'post_type' => array('post','page'),
'posts_per_page' => 1,
);
$last_updated = new WP_Query($args);
var_dump($last_updated->post->post_date);
… but that may well be overkill just to get the most recent date.
Related Posts:
- What is your best practice to execute one-time scripts?
- How should I structure a WP website project using git and updating from WP dashboard?
- WP-CLI not recognizing commercial plugin updates
- Set custom messages for post update/save
- How can I manually upgrade translations?
- Automating the Backup Process (30+ websites)
- Update to older wordpress version from admin?
- Auto-updating WordPress from a local zip file
- Permissions to get autoupdate to work
- Disable requests to api.wordpress.org
- Git Deploying – Disabling plugin/theme installation/update on remote?
- Block updates by Server
- WordPress 5.5 AutoUpdate schedule
- How long does it take for theme / plugin automatic updates to initiate?
- Can’t preview drafts after upgrade to 4.0!
- WordPress Version 5 – Another update is currently in progress
- register_activation_hook and updating
- Why won’t my site automatically apply updates after upgrade to 3.7?
- What are the details for function argument wp_update_plugin()
- Changing plugin slug with update
- Necessary user, group and permissions for core updates
- Reverting from a newer version of WordPress to an older version
- After updating wordpress 4.5 my homepage and images not displaying
- How to notify my plugin users about new version releases?
- Website not updating – no cache plugins active!
- Good methodology for upgrading a large/complex sites?
- Upgrading themes never works
- How can the temporary update directory be changed?
- Unable to update wordpress
- Auto backup before automatic WordPress updates
- WordPress not showing upgrade to latest version
- Why does WordPress 4.2.2 require FTP to update?
- Updating client websites on a regular basis
- Why won’t WordPress on localhost find updates?
- How to do an event when any user updates their profile?
- Some wp-admin folder file deleted when WordPress upgrade
- How to display user’s nickname by default instead of username
- Worpdress update another update is currently in progress
- Download failed cURL error 7: . Can’t update anything
- Upgrading from 3.5.2 to 3.9.1
- Check for files and database integrity
- WP 5 upgrade and ALTER TABLE wp_post … post_password
- Install translation files that should survive updates [duplicate]
- Fresh new install or keep old version
- How to add new theme to running website
- Updating WordPress core with zero downtime – I mean zero
- Automatic updates and merging manual changes
- WordPress curl timing out and saying ‘Moved Permanently’
- WordPress and plugins can’t update (“inconsistent file permissions” error)?
- New version doesn’t show up
- Is there a way to schedule automatic WordPress core updates?
- Updating a page won’t have any effect
- How does one dismiss the ‘upgrade notice’ when managing upgrades with SVN?
- Keep getting update notifcations despite there is nothing to update
- Is the root index.php file part of the Core?
- Why would a WordPress site go into maintenance mode without me doing anything?
- theme upgrade failing
- cannot update wordpress from 3.4.2 to 3.5
- Is it safe to update from 2.6.2 to the newest version?
- Where in the backend can I get information about the current WordPress version I am using?
- A shorter way to automatically update WordPress?
- check if WordPress website has updates remotely
- Updating WP 3.9.5 without destroying my website
- After adding mo localization files to WP 3.8.1 install backend shows new update to 3.8.1
- WordPress updates
- What do WordPress auto updates include?
- How to automate post update website check?
- How to keep cache files after plugin update?
- Which directories does WordPress attempt to create when updating core and installing plugins?
- Constant for ‘barebones’ update of WordPress
- Reliability of WordPress 4 one click update
- Can an update corrupt my installation?
- WordPress current version is 5.7.5 but I’m being prompted to “upgrade” to 4.9
- Avoid removal of a file on plugin update
- IP Address Whitelist to Allow WordPress Core Auto Updates
- How to modify last posts block without losing modification on next WP update
- Css path changed after update wordpress to new version
- Disabling forced FTP credentials for any updates
- Parent Theme update was not showing on the update page
- Auto Update A WordPress Plugin from within another WordPress Manager Plugin
- How to force an update of WordPress core to a newer minor version, using the Dashboard?
- What happend if I update my website?
- WordPress Not updating – No Cache Plugins, Admin sees updates
- How does WordPress get the upgrade URL?
- Remote site behind VPN – how to allow core & plugin updates?
- After WooCommerce-Update fucntion not working anymore
- How to allow theme update downloads to WordPress installs only?
- FS method direct on NGINX
- cannot update ftp credentials even when group owner has write access
- What could have changed all of the ' characters in my content to ' strings?
- update post meta front end
- WordPress Updates 3.5.2 to 3.8 Any Problem? [duplicate]
- Updating from WordPress 3.5.2 to 3.6 Errors
- Autoupdate shows current when I’m on 3.1
- Restoring from a Backup after Update
- Avoid loosing changes to theme
- Hook or function to check if performing a WP Core update?
- cURL error 28: SSL connection timeout while can download the plugin file
- WordPress recommending to downgrade instead of upgrade?
- WordPress is updating only patch version and not minor