Skip to content
Search → Code examplesWordPress tools

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.

About this tool

About WordPress Functions Reference

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.

WordPress Functions Reference tool

Who uses this reference

Faster answers while you code

Theme and plugin developers

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.

Security-minded reviews

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.

Learning WordPress

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.

Performance fixes

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.

Building REST endpoints

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.

Contact forms and emails

Handle form submissions securely and send notifications.

Examplewp_verify_nonce(), sanitize_text_field() and wp_mail() combine into a safe contact form handler.

WordPress coding tips

Habits that prevent bugs and security holes

Sanitise in, escape out

Clean data when you receive it (sanitize_text_field, absint) and escape it when you print it (esc_html, esc_attr, esc_url).

Nonces are not permissions

A nonce proves a request came from your form. Always check current_user_can() as well.

Cache remote calls

Wrap external API requests in a transient so slow services do not slow every page.

Generate the boilerplate

For register_post_type() with all the labels, use the CPT builder instead of typing them by hand.

Open the CPT Generator

Hook in at the right time

Register post types on init, enqueue assets on wp_enqueue_scripts, and add admin pages on admin_menu.

Always exit after redirects

wp_safe_redirect() only sends a header. Call exit straight after it, or the rest of the page keeps running.

Built & tested by

HemantInsights

Senior Software Engineer · Developer of Toolyconvert

Hemant developed WordPress Functions Reference and tests it on desktop and mobile with real files. He is a senior software engineer from Dehradun, India, building websites since 2014, and designed and developed Toolyconvert end to end.

Last updated 30 September 2026

Answers and guidanceFrequently Asked Questions
Which WordPress functions are included?
49 of the most used functions across posts, meta, users, options, terms, hooks, queries, security, assets, registration, templates, HTTP and caching, scheduling, email, redirects and AJAX.
Are the examples up to date?
Yes. They follow current WordPress practice, such as the defer loading strategy for scripts (WordPress 6.3+) and escaping all output.
What is the difference between esc_html and wp_kses_post?
esc_html() turns all HTML into plain text. wp_kses_post() keeps safe formatting tags allowed in post content and removes the rest.
Do I need wp_reset_postdata() after get_posts()?
Only if you called setup_postdata() inside the loop. After a WP_Query loop that uses the_post(), always call it.
When should I use a transient?
For data that is slow to get and fine to reuse for a while, such as an external API response. Always handle the case where it has expired and returns false.
Where can I find all parameters for a function?
Each function links to its page on developer.wordpress.org, which lists every parameter, filter and change log.
Is there a keyboard shortcut?
Yes. Press / anywhere on the page to jump to the search box.
What is the difference between add_action and add_filter?
Actions run code at a point in WordPress, such as saving a post. Filters change a value and must return it, such as the excerpt length.
How do I load CSS and JavaScript in WordPress?
Use wp_enqueue_style() and wp_enqueue_script() inside a function hooked to wp_enqueue_scripts, never hard-coded tags in header.php.
What is a nonce in WordPress?
A one-time token that proves a request came from your own form or page, protecting against cross-site request forgery. Create it with wp_nonce_field() and check it with wp_verify_nonce().
How do I make a custom REST API endpoint?
Use register_rest_route() inside the rest_api_init hook, with a namespace, route, callback and permission_callback.
How do I schedule a task in WordPress?
Use wp_schedule_event() with a recurrence such as daily and a hook name, then attach your function to that hook with add_action().
More tools for your workflowRelated Tools

Featured on

Toolyconvert is listed on these product directories and launch platforms.