Simple question:
Is there an API endpoint to retrieve the version of a specific WordPress site?
I need to monitor different WordPress sites and want to retrieve the version of these sites to be collected and checked for WordPress updates.
Is there a simple solution, something like example.com/api/version
?
2
Answers
I found a solution:
checking the content of the
/wp-admin/upgrade.php
file. It contains link tags with specific?ver=x.x.x
suffix that correspinds to the wordpress version.WordPress does not provide built-in Api endpoint like
example.com/api/version
to directly retrieve the version of site. But you can try these method:Check the
readme.html
file most wordpress havereadme.html
file in the root directory tha shows the version of wordpress. You can access byexample.com/readme.html
this file page contain version of wordpressUse the wp-json REST API: You can use the WordPress REST API to get general site information. While it does not directly return the version number, you can find it with:
example.com/wp-json/
Some security plugins may block this API or limit its information.