WordPress Functions Reference
Search 49 essential WordPress functions by name or task. Each one has a plain-English description, parameters, return value, a copy-ready example and a link to the official docs.
Search 49 essential WordPress functions by name or task. Each one has a plain-English description, parameters, return value, a copy-ready example and a link to the official docs.
Be the first to share your experience
About this tool
WordPress Functions Reference is a searchable cheat sheet of the functions WordPress developers reach for every day. It covers 49 functions across posts, post meta, users, options, terms, hooks, queries, security, loading scripts and styles, registering post types, taxonomies, shortcodes, REST routes and admin pages, templates, HTTP requests and caching, scheduled tasks, email, redirects and AJAX responses. Search by function name or by what you want to do, such as “nonce”, “enqueue” or “transient”, and narrow the list by category. Open any function to see what it does, its parameters and return value, a short working example you can copy, practical notes on common mistakes, and a link to its page on developer.wordpress.org. Examples follow current practice: they sanitise input, escape output, check capabilities and verify nonces. Press / on your keyboard to jump to the search box.

Type a function name or a task such as “redirect” or “cache”. Press / to jump to the search box.
Narrow the list to Security, Assets, Registration, Templates and more.
See the description, parameters, return value and notes on common mistakes.
Copy the working snippet, or follow the link to the full official reference.
Find functions by what they do, not just their name, across descriptions and example code.
Examples sanitise input, escape output, check capabilities and use nonces.
Short notes cover gotchas like flushing permalinks, comparing transients with === false and calling exit after redirects.
Every function links to its page on developer.wordpress.org for the full details.
Faster answers while you code
Look up the right function and its parameters without leaving your flow.
ExampleSearch “enqueue” to get wp_enqueue_script() with the defer loading strategy ready to paste.
Check that forms and endpoints use nonces, sanitising and escaping correctly.
ExampleFilter by Security to compare wp_nonce_field() and wp_verify_nonce() side by side while reviewing a form.
Understand the core building blocks through small, working examples.
ExampleA beginner opens WP_Query and get_template_part() to learn how themes list and display posts.
Find the caching and HTTP functions that stop slow API calls on every page load.
ExampleCombine wp_remote_get() with set_transient() so an external API is called once an hour, not on every visit.
Find the registration and response functions for a custom API.
Exampleregister_rest_route() with a proper permission_callback exposes a stats endpoint for an app.
Handle form submissions securely and send notifications.
Examplewp_verify_nonce(), sanitize_text_field() and wp_mail() combine into a safe contact form handler.
Habits that prevent bugs and security holes
Clean data when you receive it (sanitize_text_field, absint) and escape it when you print it (esc_html, esc_attr, esc_url).
A nonce proves a request came from your form. Always check current_user_can() as well.
Wrap external API requests in a transient so slow services do not slow every page.
For register_post_type() with all the labels, use the CPT builder instead of typing them by hand.
Open the CPT GeneratorRegister post types on init, enqueue assets on wp_enqueue_scripts, and add admin pages on admin_menu.
wp_safe_redirect() only sends a header. Call exit straight after it, or the rest of the page keeps running.