WordPress interview questions and answers for developers

WordPress interview questions test whether you can extend WordPress the way it is meant to be extended: hooks instead of edits to core, the template hierarchy and child themes, WP_Query and the main query, and the security trio of capabilities, nonces and escaping. Developer rounds add the REST API, the block editor, caching and how you deploy and migrate a site safely. Expect concept questions, a plugin or theme snippet to review, and a scenario such as a slow or hacked site.

By Published 8 min read

How WordPress interviews usually run

WordPress roles range from theme builders at agencies to plugin and platform engineers at product companies and large publishers. Agency interviews lean on themes, page performance and client handoff. Plugin and platform roles go deeper into hooks, data, security and APIs. General PHP questions (types, Composer, OOP, Laravel) live in PHP interview questions; this page stays on WordPress itself.

  1. Portfolio and screeningSites, themes or plugins you built, what you owned, and how you handled updates and hosting.
  2. Core conceptsHooks, the template hierarchy, the loop, custom post types and the database tables behind them.
  3. Code review or small buildSpot the missing nonce, the unescaped output or the query in a loop, or write a small plugin feature.
  4. Scenario talkA slow site, a plugin conflict, a hacked install or a staging-to-production migration.

WordPress fundamentals questions

Concept questions for junior and mid-level WordPress roles
QuestionWhat it testsWhat a strong answer shows
What is the difference between an action and a filter?HooksAn action runs code at a point (do_action) and returns nothing. A filter receives a value, may change it and must return it (apply_filters). Both take a priority and an accepted-arguments count.
Posts, pages and custom post types?Content modelAll live in the posts table with a post_type column. Pages are hierarchical and not in feeds; a custom post type such as event is registered with register_post_type and gets its own admin screens and templates.
Categories, tags and custom taxonomies?ClassificationTaxonomies group content. Categories are hierarchical, tags are flat, and register_taxonomy adds your own, such as venue for events.
Where is extra data stored?DatabasePost meta, term meta, user meta and the options table, each a key-value table. Knowing that meta values are stored as strings explains slow numeric meta queries.
Explain the template hierarchy for a single event post.ThemingWordPress looks for the most specific file first, such as single-event.php, then single.php, then singular.php, then index.php.
front-page.php versus home.php?Theming detailfront-page.php renders the site front page whatever it shows. home.php renders the blog posts index, which may not be the front page.
Why use a child theme?Safe customizationTheme updates overwrite the parent's files. A child theme overrides templates and adds code without touching the parent, so updates stay safe.
What is The Loop?RenderingThe pattern that iterates over the current query's posts with have_posts() and the_post(), setting up template tags such as the_title().
How should scripts and styles be added?AssetsWith wp_enqueue_script and wp_enqueue_style on the right hook, declaring dependencies and versions, never with hard-coded tags in header.php.
Plugin or functions.php for a feature?Code placementPresentation belongs to the theme. Anything that must survive a theme change, such as a custom post type, belongs in a plugin or a must-use plugin.
What is wp-config.php for?ConfigurationDatabase credentials, salts, table prefix and constants such as WP_DEBUG. It should be kept out of public repositories.
Concept questions for junior and mid-level WordPress roles. Scroll sideways on a small screen.

Intermediate: queries, security and the REST API

<?php
// Show upcoming events only, ordered by date, on the event archive.
add_action( 'pre_get_posts', function ( $query ) {
    if ( is_admin() || ! $query->is_main_query() || ! $query->is_post_type_archive( 'event' ) ) {
        return;
    }
    $query->set( 'meta_key', 'event_date' );
    $query->set( 'orderby', 'meta_value' );
    $query->set( 'order', 'ASC' );
    $query->set( 'meta_query', array(
        array( 'key' => 'event_date', 'value' => gmdate( 'Y-m-d' ), 'compare' => '>=', 'type' => 'DATE' ),
    ) );
} );

// A read-only REST route for editors, with a capability check.
add_action( 'rest_api_init', function () {
    register_rest_route( 'acme/v1', '/events/(?P<id>\d+)/attendees', array(
        'methods'             => 'GET',
        'permission_callback' => function () {
            return current_user_can( 'edit_posts' );
        },
        'callback'            => function ( WP_REST_Request $request ) {
            $event_id = absint( $request['id'] );
            $ids      = get_post_meta( $event_id, 'attendee_ids', true );
            return rest_ensure_response( is_array( $ids ) ? array_map( 'absint', $ids ) : array() );
        },
    ) );
} );
Review exercise (not executed): changing the events archive through the main query, and a safe REST route.
  • Why change the archive with pre_get_posts instead of a new WP_Query in the template? It changes the main query before it runs, so pagination, the 404 logic and conditional tags stay correct, and the database is not hit twice.
  • WP_Query, get_posts or query_posts? WP_Query for custom loops (reset with wp_reset_postdata), get_posts for a simple array, and never query_posts, which replaces the main query and breaks pagination.
  • What does the permission_callback protect, and what if it is missing? It decides who may call the route. Omitting it triggers a developer notice in recent versions, and returning true for a write route exposes it to everyone.
  • What is a WordPress nonce? A token tied to a user, an action and a time window that shows a request came from your own form or link. It defends against CSRF, not against a user without the right capability, so pair it with current_user_can.
  • Sanitize, validate or escape? Validate that input is what you expect, sanitize it before saving (sanitize_text_field, absint), and escape on output for the context: esc_html, esc_attr, esc_url or wp_kses_post.
  • How do you run a custom SQL query safely? With $wpdb->prepare and placeholders such as %d and %s, never by putting request values into the string.
  • Roles versus capabilities? Roles are named bundles of capabilities. Code should check the capability (edit_posts, manage_options) rather than the role name, so custom roles keep working.
  • admin-ajax.php or the REST API for front-end calls? Both work. REST gives proper routes, HTTP methods, schema and caching options; admin-ajax loads the admin bootstrap on every call and is mostly found in older code.
  • How do you make a plugin translatable? Wrap strings in __() or esc_html__() with a text domain and load translations; never build sentences by joining translated pieces.
  • What happens on activation and uninstall? register_activation_hook sets up options or roles and can flush rewrite rules once. Cleanup that deletes data goes in uninstall.php, not on deactivation.

Blocks, themes and modern WordPress

Block editor and theme questions
QuestionWhat it testsWhat a strong answer shows
How do you register a custom block?Block editorDescribe it in block.json (name, attributes, scripts, styles) and register it with register_block_type pointing at that folder. The editor side is JavaScript built with React components.
Static or dynamic block?Rendering choiceA static block saves its HTML in the post content. A dynamic block saves attributes and renders on the server with PHP, which suits content that changes, like latest events.
What is theme.json for?Global stylesIt sets design tokens, presets and editor settings (colors, spacing, typography) for the editor and the front end from one file.
Classic theme or block theme?Theme strategyBlock themes build templates from blocks and are edited in the Site Editor. Classic themes use PHP templates. The choice depends on who edits layouts and how much custom PHP the site needs.
Shortcodes or blocks for a new feature?Content toolingBlocks give editors a visual preview and structured attributes. Shortcodes still work but are harder for editors and for content migrations.
What is a headless WordPress setup?ArchitectureWordPress manages content and a separate front end reads it through the REST API or a GraphQL plugin. You gain front-end freedom and lose built-in previews, some plugins and theme features.
Block editor and theme questions. Scroll sideways on a small screen.

Senior and scenario questions

  • A page takes several seconds to load. How do you investigate? Separate server time from front-end time first. On the server, profile queries and hooks with a tool such as Query Monitor, look for meta queries on unindexed values, remote calls during rendering and large autoloaded options. Then add page caching and a persistent object cache, and measure again.
  • What is the object cache, and what are transients? The object cache keeps data in memory for one request unless a persistent backend such as Redis or Memcached is installed. Transients are expiring cached values; without a persistent cache they live in the options table.
  • Why can autoloaded options slow every request? Autoloaded options load on every page. Plugins that store big arrays there, and leftovers from removed plugins, add weight to each request. Audit and switch them to non-autoloaded.
  • What is WP-Cron's weakness? It runs when someone visits the site, so low-traffic sites run jobs late and busy sites check too often. Disable the visit trigger and call it from a real system cron.
  • Why can a plain SQL find-and-replace break a migrated site? Options and meta often hold PHP serialized strings with byte lengths. Changing a URL changes the length, and the value no longer unserializes. Use WP-CLI search-replace, which handles serialized data.
  • A client's site was hacked. What do you do first? Contain it (maintenance mode, change all passwords and salts), keep a copy for analysis, find the entry point in logs and outdated plugins, restore clean core and plugin files, remove injected users and code, then harden and monitor.
  • Two plugins conflict after an update. How do you isolate it? Reproduce on staging, read the debug log, disable plugins in halves until the conflict appears, then check shared hooks, priorities and script handles.
  • How do you deploy WordPress with a team? Keep the theme and custom plugins in Git, manage third-party plugins with Composer or a locked list, keep environment values in config, never push the production database down without scrubbing personal data, and use WP-CLI for repeatable steps.
  • When would you use Multisite? Many related sites that share users, plugins and updates under one install, such as a university or a franchise. Avoid it when sites need different plugin sets or separate hosting.
  • How would you load data for 50 posts without 50 extra queries? Fetch meta and terms in bulk (WP_Query primes the meta cache by default) and avoid calling functions that run their own queries inside the loop.
import re

# A widget option as PHP stores it with serialize(): s:<byte length>:"<text>";
stored = 'a:1:{s:3:"url";s:23:"https://old.example.com";}'

def naive(s, old, new):
    return s.replace(old, new)

def length_aware(s, old, new):
    def fix(m):
        text = m.group(2).replace(old, new)
        return 's:%d:"%s";' % (len(text.encode("utf-8")), text)
    return re.sub(r's:(\d+):"(.*?)";', fix, s)

print(naive(stored, "old.example.com", "new-site.example.org"))
# a:1:{s:3:"url";s:23:"https://new-site.example.org";}   length still 23: broken
print(length_aware(stored, "old.example.com", "new-site.example.org"))
# a:1:{s:3:"url";s:28:"https://new-site.example.org";}   length fixed
Why naive search-and-replace corrupts serialized data, and what a length-aware replace changes. Ran on Python 3. The regex is a teaching sketch; real migrations should use WP-CLI.

A worked scenario answer

Fictional example

Mid-level candidate: a slow events listing
Interviewer
Our upcoming events page is slow. Where would you start?
Candidate
I would open it with Query Monitor on staging and check two things: how long the main query takes and how many queries the template runs. On a similar site I found the archive sorted by a date stored as text in post meta, and each event card called a function that ran its own venue query.
Candidate
I moved the filtering into pre_get_posts with a DATE meta comparison, stored dates in a sortable format, and replaced the per-card lookups with one query for all venues on the page. Then I added a persistent object cache, because the venue data rarely changed.
Candidate
The query count dropped from over a hundred to about a dozen, and the page cache could serve most visitors. I would follow the same order here: measure, fix the queries, then cache.

One week of WordPress practice

  1. Write a small plugin that registers an event post type, a venue taxonomy and an event date meta field, with no theme edits.
  2. Add the archive change above, then break it with query_posts and watch pagination fail.
  3. Build one admin form with a nonce, a capability check, sanitizing on save and escaping on output, and explain each line.
  4. Expose one REST route and one dynamic block that both read the same events.
  5. Migrate a local site to a new domain with WP-CLI and explain why serialized data matters.
  6. Answer the slow-site, hacked-site and plugin-conflict scenarios out loud.

Natively, an AI interview assistant for Mac and Windows, works well for the last step: run a mock round, then read the transcript to see whether you named the capability check alongside the nonce or skipped it. In practice it can read a PHP snippet or a debug log from a screenshot and suggest what to inspect, and help with a small coding task. On Pro or the free trial, your résumé and the job post shape the answers it suggests, so they draw on the themes and plugins you really built, and your notes are saved for later review.

Questions people ask

What WordPress questions are asked in developer interviews?

Actions versus filters, custom post types and taxonomies, the template hierarchy and child themes, WP_Query and pre_get_posts, nonces, capabilities and escaping, the REST API and blocks. Senior rounds add caching, migrations and security incidents.

What is the difference between an action and a filter in WordPress?

An action runs your code at a set point and returns nothing. A filter passes a value through your function, which must return it, changed or not.

How do you secure a WordPress form?

Add a nonce, check the user's capability, sanitize and validate input before saving, and escape everything on output for its context.

Do WordPress interviews include a coding task?

Often. Common tasks are a small plugin with a custom post type, a theme template change, a REST endpoint, or reviewing code for missing escaping and inefficient queries.

Where to go next

Practice with the same assistant you would use on a call: it listens, transcribes and suggests answers from your own resume and the job description.

Facts on this page were last checked on . Product details come from the Natively app itself; if something here is out of date, tell us at hello@heynatively.com.

Keep reading

Put it on your own machine.

A live-conversation assistant that runs locally. Your conversations stay on your machine.

macOS 12+ · Windows 10/11

© 2026 Natively AI Private Limited

Source-available under the Natively Personal Use Source License v1.0 · IP geolocation by DB-IP