Software & Platforms

WordPress Interview Questions and Answers

WordPress powers over 40% of all websites, so WordPress developer interviews are common for agencies, startups and freelancers. These WordPress interview questions cover the dashboard, themes and plugins for beginners, then hooks, custom post types, performance, security and custom development for experienced developers.

30 questions · Updated

Reading answers is not the same as saying them.Practise WordPress questions out loud and get a score, what you missed and a model answer for each one.
Practise free with AI
WordPress Interview Questions with answers. Examples: What is WordPress, and what is the difference between WordPress.com and WordPress.org? What is the difference between posts and pages? What are themes and plugins, and how do you choose them? What are hooks in WordPress? Explain actions and filters.
WordPress Interview Questions: 30 questions with model answers on this page.

Basic WordPress interview questions

Fundamentals, definitions and simple scenarios. Good for freshers and warm-ups.

1. What is WordPress, and what is the difference between WordPress.com and WordPress.org?

Answer flow · 3 steps
  1. WordPress is a free, open-source content management system written in PHP that uses a MySQL or MariaDB database.

  2. WordPress.org is the self-hosted software: you download it, install it on your own hosting and have full control over themes, plugins and code.

  3. WordPress.com is a hosted service run by Automattic that handles hosting for you but restricts plugins and custom code on lower plans.

2. What is the difference between posts and pages?

Answer flow · 3 steps
  1. Posts are time-based content, such as blog articles or news, shown in reverse date order, with categories, tags, authors and RSS feeds.

  2. Pages are static content such as Home, About or Contact, which can be arranged in a parent-child hierarchy and use page templates.

  3. Both are stored in the wp_posts table with a different post_type.

3. What are themes and plugins, and how do you choose them?

Answer flow · 3 steps
  1. A theme controls the design and templates; a plugin adds functionality.

  2. I choose ones that are actively maintained, compatible with the current WordPress version, well reviewed and from reputable developers, and I avoid installing many plugins that do similar jobs.

  3. Every plugin adds code that can slow the site or introduce security holes, so fewer, high-quality plugins are better.

4. How do you install WordPress?

Answer flow · 3 steps
  1. Most hosts offer one-click installs.

  2. Manually, you create a MySQL or MariaDB database and user, upload the WordPress files, and run the installer in the browser, which writes wp-config.php with the database details and creates the admin account.

  3. Afterwards I set the site title, permalinks and time zone, remove default content and install only the plugins needed.

5. What user roles does WordPress have?

Answer flow · 4 steps
  1. Administrator (full control), Editor (publishes and manages everyone's posts and pages), Author (publishes their own posts), Contributor (writes posts but cannot publish), and Subscriber (manages their profile only).

  2. Multisite adds Super Admin.

  3. Each role is a set of capabilities, and plugins such as WooCommerce add roles like Shop Manager.

  4. Users should get the lowest role they need.

6. What are permalinks?

Answer flow · 3 steps
  1. Permalinks are the permanent URLs of posts and pages.

  2. The setting in Settings > Permalinks controls their structure, and "Post name" (/sample-post/) is the most readable and SEO-friendly.

  3. Changing the structure on an established site breaks old links unless redirects are added, so it should be decided before launch.

7. How do menus and widgets work?

Menus are built in Appearance > Menus, or the Site Editor's Navigation block in block themes, and assigned to locations defined by the theme, such as the header or footer. Widgets are content blocks in sidebars and footers, such as recent posts or a search box; in block themes they are replaced by blocks placed in template parts.

8. How does the media library handle images?

Answer flow · 3 steps
  1. Uploaded files go into wp-content/uploads, organised by year and month.

  2. For each image WordPress generates several sizes (thumbnail, medium, large and theme-defined sizes) and outputs responsive srcset markup and lazy loading.

  3. Images should be resized and compressed before upload or with an optimisation plugin, served as WebP or AVIF, and given alt text.

9. What is the difference between categories and tags?

Answer flow · 4 steps
  1. Categories are hierarchical (they can have sub-categories) and broadly group posts by topic, and every post must have at least one.

  2. Tags are flat and describe specific details of a post.

  3. Both are built-in taxonomies and create archive pages.

  4. Too many thin tag pages can hurt SEO, so tags should be used consistently or set to noindex.

10. How do you update WordPress safely?

Answer flow · 3 steps
  1. Take a full backup of files and the database, test updates on a staging copy first, especially major WordPress versions and important plugins, then update core, plugins and themes, and check key pages, forms and checkout afterwards.

  2. Minor security releases update automatically by default.

  3. Keeping a changelog and the ability to roll back makes updates low-risk.

11. What is wp-config.php?

wp-config.php holds the site's core configuration: database name, user, password and host, the table prefix, authentication keys and salts, and constants such as WP_DEBUG, WP_DEBUG_LOG, WP_MEMORY_LIMIT, DISALLOW_FILE_EDIT (disables the theme and plugin editor) and WP_ENVIRONMENT_TYPE. It should be protected from public access and never committed with real credentials.

Intermediate WordPress interview questions

Applied problems, trade-offs and questions about your own projects.

12. What are hooks in WordPress? Explain actions and filters.

Answer flow · 4 steps
  1. Hooks let you change WordPress behaviour without editing core files.

  2. An action runs your function at a specific point, for example add_action('wp_enqueue_scripts', 'my_scripts') to load CSS and JavaScript, or on save_post.

  3. A filter receives a value, lets you modify it and must return it, for example add_filter('the_content', 'add_disclaimer').

  4. Actions do something; filters change something.

13. What is the WordPress template hierarchy?

Answer flow · 5 steps
  1. It is the order in which WordPress looks for a template file to display a request.

  2. For a single post it tries single-{post-type}-{slug}.php, then single-{post-type}.php, single.php, singular.php and finally index.php.

  3. Pages, categories, archives and search have similar chains.

  4. Knowing it lets you create the most specific template you need instead of adding conditions to one big file.

  5. Block themes use HTML templates with the same hierarchy.

14. What are custom post types and custom fields?

Answer flow · 3 steps
  1. Custom post types let you store content other than posts and pages, such as Products, Properties or Courses, registered with register_post_type and given their own admin menu and templates.

  2. Custom fields (post meta) store extra data about each item, such as price or location, using the Advanced Custom Fields plugin or register_post_meta.

  3. Custom taxonomies like Property Type group them.

15. What is the Gutenberg block editor, and how do you create a custom block?

Answer flow · 3 steps
  1. Gutenberg is the block-based editor introduced in WordPress 5.0, where every paragraph, image or layout element is a block.

  2. To create a custom block I scaffold it with @wordpress/create-block, describe it in block.json, write the editor interface in React with the edit function, and define the saved output with save, or use render_callback in PHP for dynamic blocks.

  3. Block themes extend the same idea to whole-site editing.

16. What are WP_Query and the Loop?

The Loop is the code in theme templates that goes through the posts for the current page and displays each one with template tags such as the_title() and the_content(). WP_Query creates custom queries, for example the latest three posts from a category or products with a certain meta value, with arguments for post type, taxonomy, meta queries, ordering and pagination. wp_reset_postdata() restores the main query afterwards.

17. How should you add CSS and JavaScript in WordPress?

Answer flow · 3 steps
  1. Use wp_enqueue_style and wp_enqueue_script inside a function hooked to wp_enqueue_scripts (or admin_enqueue_scripts), with dependencies, a version number for cache busting, and strategy => "defer" or loading in the footer for scripts.

  2. Never hard-code script tags in templates.

  3. Assets should be loaded only on pages that need them, and wp_add_inline_script or wp_localize_script passes data to JavaScript.

18. What are shortcodes?

Answer flow · 3 steps
  1. Shortcodes are tags in square brackets, such as [contact_form id="3"], that plugins and themes replace with dynamic content.

  2. They are registered with add_shortcode and a callback that returns (not echoes) the output, with attributes handled through shortcode_atts.

  3. In the block editor, custom blocks are the modern replacement, but shortcodes remain common in older sites and plugins.

19. What are the Options API and transients?

Answer flow · 3 steps
  1. The Options API (get_option, update_option) stores site-wide settings in the wp_options table.

  2. Transients (set_transient, get_transient) store cached data with an expiry time, such as the result of a slow external API call, and use a persistent object cache such as Redis when available.

  3. Options with autoload set to yes load on every request, so large ones slow the site.

20. How does WP-Cron work?

Answer flow · 3 steps
  1. WP-Cron schedules tasks such as publishing scheduled posts and sending emails, registered with wp_schedule_event.

  2. It is not a real cron: it runs when someone visits the site, so on low-traffic sites tasks run late and on busy sites it adds overhead.

  3. For reliability, disable it with DISABLE_WP_CRON and trigger wp-cron.php from a real server cron job every few minutes.

21. Which database tables does WordPress use?

wp_posts stores posts, pages, attachments, menu items and custom post types; wp_postmeta stores custom fields; wp_users and wp_usermeta store users; wp_options stores settings; wp_terms, wp_term_taxonomy and wp_term_relationships store categories, tags and custom taxonomies; and wp_comments and wp_commentmeta store comments. Plugins add their own tables.

22. What are block themes and theme.json?

Block themes use HTML templates made of blocks and are edited visually in the Site Editor (full site editing), including headers, footers and templates. theme.json centrally defines global settings and styles: colour palettes, typography, spacing, layout widths and which design options users can change. Classic themes use PHP templates and the Customizer.

High level WordPress interview questions

System design, deep internals, leadership and tough follow-ups.

23. How do you optimise WordPress performance at scale?

Answer flow · 3 steps
  1. I use good hosting with PHP 8+, page caching (a plugin or server-level cache like Nginx FastCGI or Varnish) and a persistent object cache such as Redis.

  2. Static assets go on a CDN, images are compressed and lazy-loaded, and unused plugins and scripts are removed.

  3. I find slow database queries with Query Monitor, add indexes or cache results with transients, and clean bloated wp_options autoload data and post revisions.

24. How do you write secure WordPress code?

Answer flow · 3 steps
  1. I validate and sanitise all input (sanitize_text_field, absint), escape all output for its context (esc_html, esc_attr, esc_url, wp_kses), use nonces to protect forms and AJAX requests from CSRF, and check permissions with current_user_can before any action.

  2. Database queries use $wpdb->prepare to prevent SQL injection.

  3. I never trust data from users, URLs or the database without these checks.

25. How do you use the WordPress REST API?

Answer flow · 3 steps
  1. WordPress exposes content as JSON at /wp-json/wp/v2/, for example /wp-json/wp/v2/posts, which mobile apps and headless frontends such as Next.js can read.

  2. I add custom endpoints with register_rest_route, always with a permission_callback, and expose custom fields with register_rest_field or show_in_rest.

  3. Writes need authentication, such as application passwords, cookies with a nonce, or JWT.

26. What is WordPress Multisite?

Answer flow · 3 steps
  1. Multisite runs many sites from one WordPress installation, sharing the same core files, plugins and themes, with sites on subdomains or subdirectories, managed by a Super Admin.

  2. It suits universities, franchises and agencies managing many similar sites.

  3. Drawbacks are that one problem can affect every site, some plugins are incompatible, and moving a single site out is harder.

27. What is WP-CLI?

Answer flow · 3 steps
  1. WP-CLI is the command-line tool for WordPress.

  2. It installs and updates core, plugins and themes, creates users, exports and imports databases, runs search-replace on URLs during migrations (handling serialised data correctly), regenerates thumbnails, flushes caches and runs cron events.

  3. It makes maintenance scriptable and is essential for managing many sites.

28. What is headless WordPress?

Headless WordPress uses WordPress only as a content management backend, with editors working in the familiar admin, while a separate frontend built with Next.js, Astro or similar fetches content through the REST API or WPGraphQL. It gives fast, secure, modern frontends, but loses theme features and some plugins, and preview and SEO need extra work.

29. How do you deploy and migrate WordPress sites?

Answer flow · 3 steps
  1. Keep themes and custom plugins in Git and deploy them through a pipeline, while content lives in the database and uploads.

  2. For migrations, copy files and the database, then update URLs with WP-CLI search-replace or a migration plugin that handles serialised data, and test on staging.

  3. Avoid overwriting a live database that has new orders or comments; sync content carefully.

30. How do you build a well-structured custom plugin?

Use a unique prefix or PHP namespaces and Composer autoloading, organise code into classes, register activation, deactivation and uninstall hooks to create and clean up data, follow coding standards, sanitise input, escape output, check capabilities and nonces, make text translatable with __() and a text domain, load assets only where needed, and keep settings in the Options API or custom tables for large data.

Ready to test yourself?Pick your topics and level, answer by voice or text, and get instant feedback. Free.
Start a mock interview

Preparing for a wordpress & shopify developer interview?

See all WordPress & Shopify Developer interview questions, covering WordPress, WooCommerce, Shopify, Shopify Liquid, Wix and more.

Related skill interview questions

More software & platforms interview questions

HR round, company and bank interview questions

Bank and government exams

Interview questions for other fields