📡 You're offline — showing cached content
New version available!
Quick Access
Tutorials WordPress Development WordPress Interview Prep

WordPress Interview Prep

5 min read Quiz at the end
WordPress interview: actions vs filters, template hierarchy, The Loop, nonces, sanitise/escape, transients.

WordPress Interview Topics

  • Actions vs Filters -- actions: add side effects, no return value; filters: transform and return a value
  • Template hierarchy -- most specific PHP file wins; single-{slug}.php before single.php before index.php
  • The Loop -- have_posts()/the_post() iterates posts; use WP_Query for custom; always wp_reset_postdata()
  • Custom Post Types -- register_post_type() extends beyond posts/pages; set show_in_rest for Gutenberg
  • Child themes -- inherit parent, safely override templates and functions, update-proof
  • Nonces -- wp_create_nonce/wp_verify_nonce prevent CSRF on all forms
  • Sanitise/Escape -- sanitize_text_field() on input, esc_html()/esc_url() on output always
  • $wpdb->prepare() -- parameterised queries prevent SQL injection
  • Transients -- get_transient/set_transient cache expensive queries in the DB
  • pre_get_posts -- modify main query (posts_per_page, post_type) without a new WP_Query
Topic Quiz · 1 questions

Test your understanding before moving on

1. What is the difference between a WordPress action and a filter?
💡 Actions: do something (no return needed). Filters: modify and return a value (return is mandatory).