WordPress Global variables list

WordPress-specific global variables are used throughout WordPress code for various reasons. Almost all data that WordPress generates can be found in a global variables list.

To access a global variable in your code, you first need to globalize the variable with global $variable

Global variables list:


The post object for the current post from wp_post table.


The author object for the current post from WP_User table.


deals with the intricacies of a post’s (or page’s) request to a WordPress blog.


It is used internally when updating the rewrite rules, and also to find the URL of a specific post, Page, category archive, etc.


Talks with Database, uses for connecting database to UI.


(array) Object containing all registered metaboxes, including their id’s, args, callback functions and title for all post types including custom

Admin Global variables list:


(string) used in wp-admin See also get_current_screen() for the WordPress Admin Screen API


(string) used in wp-admin, used as declare new post type


(array) “allowedposttags” is used for sanitizing post_content while “allowedtags” is used for comments.