WordPress Developer interview questions
100 real questions with model answers and explanations for Junior WordPress Developer candidates.
See a WordPress Developer resume example →Practice with flashcards
Spaced repetition · Hunter Pass
Questions
WordPress combines PHP application code, a database, themes, plugins, and uploaded media to serve a site.
- WordPress core provides the request handling, admin area, content APIs, users, and common services.
- A theme controls presentation, while plugins add or change behavior without editing core.
- MySQL or MariaDB stores content and settings, while wp-content/uploads normally stores media files.
Why interviewers ask this: The interviewer checks whether you can separate core, data, presentation, extensions, and media at a basic level.
The three directories separate administration, core libraries, and site-owned extensions and assets.
- wp-admin contains files used by the dashboard and administrative requests.
- wp-includes contains most WordPress core functions, classes, and bundled libraries.
- wp-content holds themes, plugins, and uploads, so custom work belongs there rather than in core directories.
Why interviewers ask this: A strong answer identifies where custom code belongs and avoids treating core files as editable project code.
WordPress stores content, users, comments, taxonomy relationships, and configuration in related database tables.
- wp_posts holds posts, pages, attachments, and custom post type records, with extra fields in wp_postmeta.
- wp_terms and related taxonomy tables represent categories, tags, and custom taxonomies.
- wp_options stores site-wide settings, while wp_users and wp_usermeta store accounts and user-specific data.
Why interviewers ask this: The interviewer checks whether you understand the shared data model behind common WordPress content types.
WordPress loads its environment, interprets the URL, runs the main query, selects a template, and sends the rendered response.
- Rewrite rules turn a friendly URL into query variables that describe the requested content.
- WordPress builds the main WP_Query and sets conditional state such as is_page() or is_archive().
- The template loader follows the active theme hierarchy, where PHP and template tags produce the HTML response.
Why interviewers ask this: The interviewer is evaluating a conceptual request lifecycle rather than detailed knowledge of every core file.
The root index.php is the front controller that starts WordPress for normal front-end requests.
- Web server rewrite rules direct many public URLs to this single entry point.
- It loads wp-blog-header.php, which bootstraps WordPress and starts template output.
- The theme also has an index.php, but that file is the final classic-template fallback, not the application entry point.
Why interviewers ask this: A strong answer distinguishes the root front controller from the classic theme fallback template.
Query variables are values WordPress uses to describe which content a request should retrieve.
- A request may resolve to values such as post_type, name, page_id, category_name, or paged.
- WP_Query reads these values to build the main database query and establish request context.
- Public custom query variables can be added with the query_vars filter when a feature genuinely needs them.
Why interviewers ask this: The interviewer checks whether you can connect URL parsing to the main content query.
A minimal classic theme needs style.css and index.php to be recognized and render content.
- style.css contains the theme header with fields such as Theme Name and also may contain styles.
- index.php is the fallback when no more specific template exists.
- A real theme normally adds functions.php, header.php, footer.php, and specific hierarchy templates for maintainability.
Why interviewers ask this: The interviewer checks the minimum classic-theme contract and whether you know the usual supporting files.
The template hierarchy is the ordered set of theme files WordPress checks for the current request.
- A single post can match single-{post-type}-{slug}.php, single-{post-type}.php, single.php, singular.php, then index.php.
- More specific files let a theme customize one content context without conditional logic in a universal template.
- The hierarchy ends at index.php in a classic theme, so the request can still render when specific files are absent.
Why interviewers ask this: A strong answer explains both the ordered fallback and why specific templates are useful.
Conditional tags report what kind of request WordPress resolved so a theme can choose context-specific output.
- Functions such as is_front_page(), is_single(), and is_archive() return boolean values for common request types.
- They inspect the established query context, so most of them should be used only after WordPress has run the main query.
- I use them for small variations and prefer the template hierarchy when an entire view needs different markup.
Why interviewers ask this: The interviewer checks whether you can inspect request context without replacing the template hierarchy with one large conditional file.
front-page.php targets the site's front page, while home.php targets the posts index.
- If a static page is configured as the homepage, front-page.php can render that page.
- If another page is configured for posts, home.php renders the blog listing there.
- When the front page shows latest posts, front-page.php takes priority over home.php if both exist.
Why interviewers ask this: The interviewer checks a frequently confused part of the template hierarchy.
single.php handles individual posts, page.php handles Pages, and singular.php can be their shared fallback.
- A standard blog post normally resolves through single.php after more specific single templates.
- A Page normally resolves through custom page templates and page-specific files before page.php.
- singular.php is checked when a singular post, page, or custom post type lacks a more specific matching template.
Why interviewers ask this: A strong answer maps each file to request context and recognizes the shared singular fallback.
WordPress can select archive templates by archive type before falling back to archive.php and index.php.
- category.php, tag.php, and taxonomy.php cover built-in or custom term archives, with more specific variants available.
- author.php and date.php cover author and date archives.
- archive-{post_type}.php handles a custom post type archive when that post type enables an archive.
Why interviewers ask this: The interviewer checks whether you can choose an archive template without filling one file with unrelated conditions.
A child theme inherits a parent theme and keeps custom changes separate from parent updates.
- Its style.css declares the parent directory in the Template header.
- Its templates can override matching parent templates, while its functions.php loads in addition to the parent's file.
- I use one to customize a maintained third-party theme, but not as a substitute for a plugin when behavior is theme-independent.
Why interviewers ask this: The interviewer checks whether you can preserve customizations and place presentation versus behavior appropriately.
I use WordPress template-loading functions instead of copying shared markup between files.
- get_header(), get_footer(), and get_sidebar() load the corresponding theme sections.
- get_template_part() loads reusable pieces such as content-card.php and supports named variants.
- These functions let child themes override parts and give plugins WordPress lifecycle hooks around template loading.
Why interviewers ask this: A strong answer names the standard APIs and explains why direct file inclusion is less flexible.
The Loop iterates over posts returned by the current WP_Query and sets each one as the current post.
- have_posts() checks whether another result is available, and the_post() advances to it.
- Inside the loop, template tags such as the_title(), the_content(), and the_permalink() use current-post context.
- The main theme loop usually renders the content selected by WordPress for that request.
Why interviewers ask this: The interviewer checks whether you understand the central connection between WP_Query results and template tags.
the_post() advances the query and prepares global post data for template tags.
- have_posts() only tests whether another result exists and does not move the query pointer.
- the_post() makes functions such as the_title() refer to the current result.
- Omitting it can leave the loop stuck or make template tags read stale context.
Why interviewers ask this: A strong answer distinguishes checking iteration state from advancing and setting post context.
I call wp_reset_postdata() after a secondary WP_Query loop that used the_post().
- A custom loop changes the global $post used by many template tags.
- Resetting restores the current post from the main query so later tags show the expected content.
- wp_reset_query() is broader and is rarely needed for an ordinary secondary WP_Query.
Why interviewers ask this: The interviewer checks whether you can prevent a secondary loop from leaking context into the rest of a template.
Hooks are named extension points that let code run or change values without editing WordPress core.
- Actions notify callbacks that an event or stage has occurred.
- Filters pass a value through callbacks and use the returned value.
- Plugins and themes register callbacks with add_action() or add_filter(), which keeps custom behavior loosely connected to core.
Why interviewers ask this: The interviewer checks whether you understand the extension mechanism behind WordPress customization.
An action performs work at a hook, while a filter receives a value and must return the resulting value.
- An action callback might register a post type on init or print markup in wp_footer.
- A filter callback might change excerpt_length or modify a title before display.
- Forgetting to return the value from a filter can replace it with null and break later behavior.
Why interviewers ask this: A strong answer gives concrete uses and states the filter return-value contract.
Priority controls callback order, and accepted arguments controls how many hook parameters the callback receives.
- Lower priority numbers run earlier, while callbacks with the same priority follow registration order.
- The default priority is 10, which is usually suitable unless ordering is required.
- The fourth parameter must match how many provided values the callback intends to accept.
Why interviewers ask this: The interviewer checks whether you can register a callback with the right timing and signature.
Locked questions
- 21
When would you remove a WordPress hook callback?
wordpresshookscallbacks - 22
What belongs in a classic theme's functions.php?
themes - 23
What is the basic structure of a WordPress plugin?
wordpressplugins - 24
What does the plugin header do?
plugins - 25
What should activation and deactivation hooks do?
activationhooks - 26
How should a plugin remove its stored data on uninstall?
plugins - 27
Why should plugin functions, classes, and constants be prefixed or namespaced?
pluginskubernetes - 28
What is a custom post type?
cpt - 29
When and how should you register a custom post type?
cpt - 30
What is a custom taxonomy?
taxonomies - 31
When would you use post meta instead of an option?
- 32
Which PHP data types do you commonly use in WordPress code?
wordpress - 33
How does variable scope affect WordPress PHP code?
wordpressscope - 34
What is WP_Error and how should you handle it?
- 35
How should a theme or plugin load CSS and JavaScript?
cssthemesjavascript - 36
What do dependencies, versions, and loading strategy mean when enqueueing a script?
assetsdependencies - 37
How do you pass server-generated data to an enqueued JavaScript file?
assetsjavascript - 38
How do you create a basic custom query with WP_Query?
querieswp-query - 39
How do you render and clean up after a secondary WP_Query?
wp-query - 40
How can you change the main WordPress query correctly?
querieswordpress - 41
What is the difference between sanitizing, validating, and escaping data?
validationescaping - 42
Which WordPress sanitization functions would you use for common form fields?
formsvalidationwordpress - 43
How do you choose the correct escaping function in WordPress?
escapingwordpress - 44
What is a WordPress nonce and what does it protect against?
noncewordpress - 45
How do you check whether a WordPress user may perform an action?
wordpress - 46
How should you safely run a custom SQL query with $wpdb?
sqlquerieswpdb - 47
What is a block in modern WordPress?
wordpress - 48
How does a block theme differ from a classic theme?
themesblock-themes - 49
What can a user edit in the WordPress Site Editor?
block-themeswordpress - 50
What is theme.json used for?
themesblock-themes - 51
How would you implement a [team_member] shortcode that accepts a person ID safely?
shortcodes - 52
How would you add layout and color attributes to a custom shortcode without allowing arbitrary markup or CSS?
cssshortcodes - 53
How would you load a shortcode's CSS only on pages where the shortcode is used?
cssshortcodes - 54
How would you add a small contact widget to a classic theme sidebar?
themeswidgets - 55
How would you replace a simple legacy widget with an editor-friendly modern solution?
widgets - 56
How would you implement a public Portfolio custom post type with project categories?
cpt - 57
How would you give Portfolio items their own single, archive, and taxonomy layouts in a classic theme?
themestaxonomies - 58
How would you investigate Portfolio pages returning 404 after changing the custom post type rewrite slug?
cpt - 59
How would you implement and safely save a custom 'Client URL' meta box for Portfolio items?
- 60
How would you build an ACF Pro field group for a reusable project card and consume it safely in a theme?
themes - 61
How would you update existing Portfolio metadata from a WP CLI command without loading every post at once?
- 62
How would you implement a paginated 'Latest Projects' listing with a secondary WP_Query?
wp-query - 63
How would you fix repeated or missing items when a paginated WP_Query also uses offset?
wp-query - 64
How would you show twelve Portfolio items per project category archive without affecting admin lists or other queries?
queries - 65
How would you fix a page title that changes to the last project after a custom project loop?
- 66
How would you investigate a plugin script that is enqueued but missing from the rendered page?
assetsplugins - 67
How would you diagnose the same JavaScript library loading twice on a WordPress page?
wordpressjavascript - 68
How would you load a gallery script only on the Portfolio edit screen in wp-admin?
- 69
How would you fix a front-end script that runs before its dependency or before its target markup exists?
dependencies - 70
How would you fix a custom post type registered too late for its archive URL and editor integration to work correctly?
cpt - 71
How would you fix a the_content filter that makes post content disappear?
hooks - 72
How would you replace a parent theme callback that is already attached to wp_footer?
themescallbacks - 73
How would you investigate a white screen that appeared after editing functions.php?
themes - 74
How would you investigate PHP warnings in debug.log without showing them to visitors?
- 75
How would you isolate which plugin breaks the block editor on a local copy of a site?
gutenbergplugins - 76
How would you customize a parent theme's single-post layout so updates do not erase the change?
themes - 77
How would you customize the WooCommerce single-product layout without editing plugin files?
pluginswoocommerce - 78
How would you implement a front-end contact form in a plugin from submission to confirmation?
formsplugins - 79
How would you return useful validation errors from a custom settings form without trusting submitted values?
formsvalidation - 80
How would you protect an admin action that deletes a saved Portfolio note?
- 81
How would you fix a template that escapes all data when saving but prints it raw into links and attributes?
escaping - 82
How would you implement an AJAX 'load more projects' button for visitors?
ajax - 83
How would you add a small REST API endpoint that lets authorized editors update a Portfolio status?
restendpoints - 84
How would you safely query a custom plugin table for orders created after a submitted date?
queriesplugins - 85
How would you insert a row into a custom table and handle a database failure?
database - 86
How would you reduce unnecessary database queries in a template that renders twenty project cards?
databasequeries - 87
How would you cache an expensive external API result for a WordPress dashboard widget?
widgetsapicaching - 88
How would you keep a transient-cached Portfolio list fresh after editors change projects?
caching - 89
How would you use WP CLI to investigate whether a plugin and its scheduled task are active?
plugins - 90
How would you prepare a child-theme fix in Git so another developer can review it safely?
themesgit - 91
How would you fix a three-column project grid that overflows on phones?
gridschema - 92
How would you organize and build Sass for a custom theme without shipping source maps or duplicate CSS accidentally?
cssthemessource-maps - 93
How would you fix a block theme template change that works in the Site Editor but not after deploying the theme files elsewhere?
themesblock-themesdeployment - 94
How would you create one reusable header for all templates in a block theme?
themesblock-themes - 95
How would you provide editors with a predesigned testimonial section they can insert and edit?
- 96
How would you configure a Query Loop in a block theme to show the latest six Portfolio items as cards?
themesblock-themesqueries - 97
How would you add a controlled brand color palette to a block theme and remove arbitrary color choices?
formsthemesblock-themes - 98
How would you apply a responsive typography scale to headings in theme.json?
responsivethemesblock-themes - 99
How would you standardize section spacing in a block theme without adding custom classes to every Group block?
themesblock-themes - 100
How would you implement a simple dynamic Gutenberg block that displays the current Portfolio item's client name?
gutenberg