Home / Blog / WordPress

53 WordPress interview questions and answers

First published 29 May 2023. Checked again in November 2026; WordPress changes quickly, so check the linked documentation before an interview.

Interview Questions and Answers

WordPress is a free, open-source content management system (CMS) for managing the content on your website. It makes it easy to get a site up and running.

One of the remarkable aspects of WordPress is its thriving and supportive community, which is considered one of the most valuable resources on the web. Numerous websites, spanning various categories such as news, updates, resources, tutorials, and training, rely on WordPress to power their online presence. In fact, about 40% of all websites and nearly 60% of websites that use a known content management system are powered by WordPress (W3Techs, November 2026). Its widespread adoption as the preferred choice among website builders can be attributed to its user-friendly nature and the fact that it is available for free.

This article collects 53 WordPress interview questions and answers. They suit freshers and experienced professionals alike. Whether you are preparing for an interview or simply want to expand your knowledge, I encourage you to work through them.

WordPress interview questions and answers

  1. What is WordPress?
    – WordPress is a popular open-source content management system (CMS) that allows users to create and manage websites easily.
  2. What is the difference between WordPress.com and WordPress.org?
    – WordPress.com is a hosted platform where you can create a website for free, while WordPress.org is a self-hosted platform where you need to have your own domain and web hosting.
  3. What are the minimum requirements to install WordPress?
    – WordPress recommends PHP 8.3 or newer and MySQL 8.0 or newer or MariaDB 10.11 or newer. It still runs on PHP 7.4 and MySQL 5.5.5, but both are end of life. Apache and Nginx are recommended; any server with PHP and MySQL works. See the WordPress requirements page.
  4. How can you install WordPress?
    – You can install WordPress manually by downloading the package from WordPress.org, extracting it, creating a database, and configuring the necessary files. Alternatively, many hosting providers offer one-click installations.
  5. What is a theme in WordPress?
    – A theme controls how a site looks and is laid out. Block themes (WordPress 5.9+) build every part of the site, header and footer included, from blocks edited in the Site Editor. Classic themes use PHP templates and functions.php. As a rule of thumb, functionality that must survive a theme switch belongs in a plugin.
  6. How can you create a child theme in WordPress?
    – To create a child theme, create a new folder in the themes directory of your WordPress installation and add a style.css file. style.css must include the Template header with the parent’s folder name. You can also add a functions.php file for extra functionality. Block-theme children usually need no enqueue code because styling lives in theme.json. See the child themes documentation.
  7. What are plugins in WordPress?
    – Plugins are packages of code that extend the functionality of WordPress. They can be used to add new features, enhance existing features, or modify the behavior of the site.
  8. How can you install a plugin in WordPress?
    – You can install a plugin in WordPress by navigating to the “Plugins” section in the WordPress dashboard, clicking on “Add New,” and searching for the desired plugin. Once found, you can click on “Install Now” and then “Activate” to enable the plugin.
  9. How can you create a custom page or post template in WordPress?
    – In a classic theme, add a PHP file with a Template Name: header comment. Add Template Post Type: to offer the template for posts or custom post types (WordPress 4.7+). In a block theme, add an HTML file in /templates and register it under customTemplates in theme.json, or create it in the Site Editor. See the page template files documentation.
  10. What are shortcodes in WordPress?
    – Shortcodes are small snippets of code that allow you to add dynamic content or functionality to your WordPress posts and pages. They are represented by square brackets and a keyword, such as [example-gallery] or [example-contact-form].

  11. What is the difference between posts and pages in WordPress?
    – Posts are typically used for blog content and are displayed in reverse chronological order, while pages are used for static content like “About,” “Contact,” and “Services” pages.
  12. How can you add a custom navigation menu in WordPress?
    – In a classic theme, go to Appearance > Menus, create a new menu, add menu items and assign it to a location in your theme. In a block theme (WordPress 6.0+), you edit the Navigation block in the Site Editor instead. See the Appearance Menus screen documentation.
  13. How can you optimize a WordPress website for search engines (SEO)?
    – You can optimize a WordPress website for SEO by using SEO plugins like Yoast SEO or All in One SEO (AIOSEO), optimizing meta tags and descriptions, creating XML sitemaps, improving site speed, and using relevant keywords in your content.
  14. What is a permalink, and what is a permalink structure?
    – A permalink is the permanent link to a WordPress post, page or other content. The permalink structure is the format WordPress uses to build those URLs. It is customisable and can include elements such as the post title, date and category, which determine the hierarchy and other attributes that make up the URL.
  15. How can you change the permalink structure in WordPress?
    – You can change the permalink structure in WordPress by going to the “Settings” section in the WordPress dashboard and selecting “Permalinks.” There, you can choose from various permalink structure options or create a custom structure.
  16. What are custom post types in WordPress?
    – Custom post types allow you to create and manage different types of content beyond the default posts and pages. Examples of custom post types include portfolio items, testimonials, events, etc.
  17. How can you create a custom post type in WordPress?
    – Call register_post_type() on the init hook. Do it from a plugin rather than a theme if the content should survive a theme change. Alternatively, use a plugin such as Custom Post Type UI. The code or plugin defines the custom post type’s name, labels and settings.
  18. What is a widget in WordPress, and how do you add one?
    – Widgets are blocks or legacy widgets placed in a theme’s widget areas, such as sidebars and footers. On classic themes you add them under Appearance > Widgets, which has been the block-based widgets editor since WordPress 5.8: drag a widget into an available widget area. Block themes have no widget areas and no Appearance > Widgets screen; you place blocks in templates and template parts instead. See the block-based widgets editor documentation.
  19. How can you create a custom widget in WordPress?
    – Create a new PHP file, extend the WP_Widget class and define the widget’s appearance and functionality. Then register it with register_widget() on the widgets_init hook, for example from your theme’s functions.php file.
  20. What is the difference between categories and tags in WordPress?
    – Categories and tags are both taxonomies used for organizing content. Categories are hierarchical, allowing for subcategories, while tags are non-hierarchical and represent specific topics or keywords.
  21. How can you add an image gallery in WordPress?
    – In the block editor, add a Gallery block (type /gallery), then upload images or pick them from the Media Library. The Add Media > Create Gallery route applies to the classic editor. See the Gallery block documentation.
  22. How can you optimize the performance of a WordPress website?
    – You can optimize the performance of a WordPress website by using caching plugins, optimizing images, minifying CSS and JavaScript files, enabling browser caching, using a content delivery network (CDN), and choosing a reliable hosting provider.
  23. What is the WordPress loop?
    – The WordPress loop is a PHP code structure used to retrieve and display posts or other content from the WordPress database. It typically consists of a query to fetch the content and a loop to iterate through and display it. Block themes use the Query Loop block for the same job. See the block themes documentation.
  24. What is a hook in WordPress?
    – In WordPress, hooks are a way to modify or add functionality to different parts of the core code or themes and plugins. There are two types of hooks: action hooks, which allow you to perform actions at specific points, and filter hooks, which allow you to modify data.
  25. How can you create a custom post status in WordPress?
    – You can create a custom post status in WordPress by using the register_post_status() function. This allows you to define a new status label, capabilities, and other settings for the custom post status.
  26. What is the difference between get_posts() and WP_Query() in WordPress?
    – get_posts() is a thin wrapper around WP_Query that returns an array of posts. By default it suppresses query filters, ignores sticky posts and skips pagination counts, and it returns 5 posts unless numberposts says otherwise. Use WP_Query when you need pagination, filters or the loop methods. See the get_posts() reference.
  27. How can you display related posts in WordPress?
    – You can display related posts in WordPress by using plugins like YARPP (Yet Another Related Posts Plugin) or by manually querying posts with similar tags or categories and displaying them in your theme’s template files.
  28. What is the WordPress REST API?
    – The WordPress REST API is an interface that allows developers to access and interact with WordPress data using standard HTTP methods. It enables retrieving, creating, updating, and deleting content remotely.
  29. How can you add custom CSS to a WordPress website?
    – In a classic theme, go to Appearance > Customize > Additional CSS. In a block theme, go to Appearance > Editor > Styles, then Additional CSS (WordPress 6.2+; in 6.9 it sits in the ellipsis menu of the Styles header). Custom CSS survives theme updates but is cleared when you switch themes. See the Styles overview.
  30. How can you create a custom post meta box in WordPress?
    – You can create a custom post meta box in WordPress by using the add_meta_box() function. This allows you to define the appearance and behavior of the meta box and save its data using the save_post hook. In the block editor, register the meta with show_in_rest so blocks can bind to it.
  31. How can you make a WordPress website multilingual?
    – You can make a WordPress website multilingual by using plugins like WPML (WordPress Multilingual) or Polylang. These plugins provide functionality to translate content, manage multiple languages, and switch between language versions.
  32. How can you create a custom login page in WordPress?
    – You can create a custom login page in WordPress by creating a custom template file for the login page and modifying the login URL using code in your theme’s functions.php file or a plugin.
  33. What are transients in WordPress?
    – Transients store temporary data with an expiry. By default they sit in the wp_options table, but with a persistent object cache they live in that cache instead. The expiry is a maximum, so always handle a false return by regenerating the data. They are often used to cache expensive database queries or API requests. See the Transients API documentation.
  34. How can you create a custom WordPress theme?
    – A classic theme needs style.css and index.php. A block theme’s only required template is templates/index.html. Add theme.json for settings and styles, /parts for template parts and /patterns for patterns. See the template hierarchy, template parts and theme.json documentation.
  35. What is the difference between single.php and page.php in WordPress?
    – single.php is a template file used to display individual posts, while page.php is used to display individual pages. In a block theme the equivalents are single.html and page.html. See the template hierarchy.
  36. How can you enable or disable comments on WordPress posts?
    – Go to the “Settings” section in the WordPress dashboard, select “Discussion” and tick or untick “Allow people to submit comments on new posts”. That setting only sets the default for new posts. Individual posts can override it, so it does not close comments on existing posts.
  37. How can you create a custom taxonomy in WordPress?
    – You can create a custom taxonomy in WordPress by using the register_taxonomy() function. This allows you to define a new taxonomy name, labels, and settings. Custom taxonomies are often used to categorize and organize content.
  38. What is the WordPress Template Hierarchy?
    – The WordPress Template Hierarchy is a system that determines which template file is used to display different types of content in WordPress. It follows a specific order and allows you to customise the appearance of various content types. In a block theme the same hierarchy resolves to HTML files (single.html, page.html, archive.html) and ends at index.html. See the template hierarchy documentation.
  39. How can you create a custom shortcode in WordPress?
    – You can create a custom shortcode in WordPress by defining a function that returns the desired content and registering it using the add_shortcode() function. Once registered, you can use the shortcode by typing its name inside square brackets.
  40. What is the difference between wp_title() and the_title() in WordPress?
    – wp_title() is the old way to print the page title in header.php. Themes should now declare add_theme_support( 'title-tag' ) and let WordPress print the document title. the_title() prints a post’s own title inside the loop. See the add_theme_support() reference and the wp_title() reference.
  41. How can you switch from the block editor back to the classic editor?
    – You can switch back to the classic editor by installing and activating the “Classic Editor” plugin. This plugin restores the previous editor interface and functionality. The block editor (Gutenberg) has been in WordPress core since version 5.0. See the block editor FAQ.
  42. What is the difference between do_action() and apply_filters() in WordPress?
    – do_action() is a function used to execute actions at specific points in the WordPress code, allowing other code to hook into those actions. apply_filters() is used to filter and modify data before it is outputted.
  43. How can you add a custom logo to a WordPress website?
    – In a classic theme, go to Appearance > Customize > Site Identity. In a block theme, use the Site Logo block in the Site Editor header. See the block themes documentation.
  44. How can you change the number of posts displayed on a WordPress archive page?
    – Go to Settings > Reading and change “Number of recent posts shown on archive pages”.
  45. How can you restrict access to certain content in WordPress?
    – You can restrict access to certain content in WordPress by using membership plugins like MemberPress or Restrict Content Pro. These plugins allow you to define membership levels, restrict access to content based on membership, and handle payments.

Block themes and full site editing

  1. What is a block theme, and how does it differ from a classic theme?
    – A block theme uses blocks for every part of a site, header, content and footer included, and is edited in the Site Editor. Block themes arrived in WordPress 5.9. Classic themes use PHP templates and functions.php and provide the Widgets screen, a Menus screen and the Customizer. The only required template in a block theme is templates/index.html. See the block themes documentation and the template hierarchy.
  2. What is theme.json and what can it control?
    – theme.json is the configuration file at the centre of block theming. It is not strictly required, but nearly any theme project needs it. Its sections cover settings (colours, typography and other options), styles, custom templates, template parts, patterns and style variations. See the theme.json documentation.
  3. What is the difference between a template and a template part in a block theme?
    – Templates are HTML files in /templates, resolved through the template hierarchy with index.html as the fallback. Template parts live directly in /parts (no nested folders) and load only when a template includes them with the Template Part block and a slug. Register them in theme.json under templateParts with an area. See the template parts and template hierarchy documentation.
  4. What are Global Styles and where do users edit them?
    – Styles is the Site Editor panel (Appearance > Editor) for site-wide typography, colours, layout and per-block styles. It needs a block theme and WordPress 5.9 or newer. A user’s choices override the defaults in the theme’s theme.json. Style variations arrived in WordPress 6.0 and Additional CSS inside Styles in 6.2. Custom CSS survives theme updates and is cleared when you switch themes. See the Styles overview.
  5. How do you register block patterns in a theme?
    – Put a file in the theme’s /patterns folder with a header that includes at least Title, Slug and Categories (write the slug as namespace/pattern-name), or call register_block_pattern() on the init hook. Register each pattern by only one of these methods. Categories come from register_block_pattern_category(). See the registering patterns documentation.
  6. What are Block Bindings?
    – Block Bindings is an API (WordPress 6.5+) that binds dynamic data to block attributes. Supported attributes include Paragraph and Heading content, Image url and alt, plus Button url and text, among others. A custom source is registered with register_block_bindings_source() on the init hook. The core core/post-meta source needs the meta registered with show_in_rest, and the keys must not start with an underscore. core/post-data and core/term-data need WordPress 6.9+. See the Block Bindings documentation.
  7. What is the Interactivity API?
    – The Interactivity API is a standard way to add front-end interactions to blocks. It was introduced in WordPress 6.5 (earlier versions need Gutenberg 17.5+). A block opts in by setting interactivity to true under supports in block.json, marks elements with the data-wp-interactive directive and loads a view.js file as a script module through viewScriptModule. The store comes from @wordpress/interactivity. See the Interactivity API documentation.
  8. Where did menus, widgets and the Customizer go in a block theme?
    – Menus are the Navigation block; Appearance > Menus was last shown by default in WordPress 5.9. Widget areas no longer exist, so Appearance > Widgets is removed and you place content with patterns and template parts. The Customizer is not available unless a plugin or theme requires it. Site title, tagline and logo are blocks, and colours are set in Styles. See the documentation for the Appearance Menus screen, the block-based widgets editor and block themes.

Conclusions

WordPress is an open-source content management system (CMS) that simplifies building a website. It runs about 58% of the websites whose CMS is known (W3Techs, November 2026). If you want to build a career as a WordPress developer, this article is meant to help.

Given the demand for WordPress, interviewers can ask about almost anything. I have tried to answer most of the common questions here. If you familiarise yourself with them and practise your answers, you will go into the interview with more confidence. I hope this article has answered any queries you had.

Wishing you the best in your future endeavours.

I used AI to help draft this post from my own idea and notes. I verified the information and edited the text myself.

Dhiren Patel

Principal Full-Stack Engineer · Founder, Exivon Tech

I’ve built and run enterprise web platforms and e-commerce for 13 years, and I built ShieldScope, a free WordPress security scanner, and Lede, a free block theme.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.