I'm a wordpress designer & developer and I want to know if if it's possible to check my wordpress version in tables of mysql database to print it in an administration panel page ?
The first thing you need to do is to log in to the admin dashboard of your WordPress site. From there, scroll down to the bottom of the page. On that page, you can see your WordPress version number in the admin widget labeled At a Glance.
WordPress uses a database management system called MySQL, which is open source software.
php File. The most reliable and accurate way to check your WordPress version is to directly access version. php within your site's files. To do this, your website will need to be live with a web hosting account so you can get your FTP login credentials, or use cPanel to access the internal files.
WordPress uses MySQL for its database management system. MySQL is open-source software, and it is responsible for managing the components of a WordPress database such as user data, user meta, posts, comments, and so on. We will discuss it a little bit later.
Should be in wp_options table, the field is called db_version. So, yes, it's possible.
You can run this SQL command (substitute your table name if different):
SELECT * FROM `wp_options` where option_name = 'db_version'
Make sure to consult the codex, as the db_version looks different from the wp version. for instance:
For Version 3.1, the database version (db_version in wp_options) changed to 17056, and the Trac revision was 17485.
See https://codex.wordpress.org/WordPress_Versions for a cross reference of db_version (database version) to Word Press release.
Alternatively, you can find the file in the wordpress installation, inside the folder "wp-incudes". The file is called version.php and defines a global variable like so:
/** * The WordPress version string * * @global string $wp_version */ $wp_version = '3.7.1';
I'm afraid that the accepted answer to this question is no longer accurate.
You cannot use db_version from wp_options because the db_version does not always change between Wordpress updates (eg. with maintenance releases). I have multiple installations of Wordpress and I have confirmed that the db_version for v5.8 has remained the same in v5.8.1. Additionally, if you look at the reference at http://codex.wordpress.org/WordPress_Versions you will also find that the same DB version numbers are used across multiple releases of Wordpress. Therefore, you are unable to rely on db_version to determine what version of Wordpress you are running.
However, you can query _site_transient_update_core in wp_options and look in the option_value for the version number after "version_checked". For example:
SELECT option_value FROM wp_options WHERE (option_name IN ('_site_transient_update_core'));
Would produce an output in option_value and I find in there:
s:15:"version_checked";s:5:"5.4.7";
My Wordpress version is v5.4.7.
Reference: https://wordpress.org/support/topic/obtaining-wp-version-from-database/ which provides further information on the _site_transient_update_core database option and the reliability of querying it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With