Whether you are preparing for a university BCA viva voce examination, interviewing for a Junior WordPress Developer role, or screening candidates as an enterprise technical lead, this curated repository provides 100+ comprehensive WordPress technical questions and answers categorized across core architecture, PHP theme engineering, hooks, database internals, and performance optimization.
WordPress is an open-source Content Management System (CMS) written in PHP and paired with a MySQL/MariaDB database. It was founded on May 27, 2003, by Matt Mullenweg and Mike Little as a fork of b2/cafelog.
WordPress.org is the self-hosted open-source software that you download and deploy on your own web server with complete code, database, and monetization freedom. WordPress.com is a commercial hosted platform operated by Automattic with subscription paywalls for custom plugins and code access.
The wp-config.php file is the master configuration file of WordPress. It stores MySQL database credentials (DB_NAME, DB_USER, DB_PASSWORD, DB_HOST), cryptographic authentication salts, the database table prefix ($table_prefix), and debug constants like WP_DEBUG.
1) /wp-admin/ (administrative back-end screens); 2) /wp-includes/ (core PHP classes, API libraries, and scripts); 3) /wp-content/ (user and developer directory containing themes, plugins, and media uploads).
Modifying core files ("hacking core") breaks backwards compatibility and guarantees that your custom code will be completely wiped out during the next automatic security update. All customizations must be achieved via Hooks (Actions & Filters) in plugins or child themes.
Posts are dynamic, time-sensitive blog articles organized chronologically with dates, categories, tags, author archives, and RSS feed syndication. Pages are static, timeless content (About Us, Contact, Privacy Policy) that support hierarchical parent/child nesting and custom page templates, but lack categories and tags by default.
Both are stored in the exact same table: wp_posts. They are differentiated by the value in the post_type column (post_type = 'post' vs post_type = 'page').
wp_posts, wp_postmeta, wp_users, wp_usermeta, wp_options, wp_comments, wp_commentmeta, wp_terms, wp_term_taxonomy, wp_term_relationships, wp_termmeta, and wp_links.
Only two files: style.css (containing the theme header comment) and index.php (the master template fallback).
A Child Theme inherits all functionality and styling from its Parent Theme. Custom code written in a child theme's style.css or functions.php is preserved permanently when the parent theme receives official updates.
The Loop is the core PHP mechanism WordPress uses to iterate through post records returned by a database query, setting up global post data so template tags (the_title(), the_content()) render the current post's content.
The Template Hierarchy is the deterministic visual decision tree WordPress follows to choose which PHP file in your theme renders a specific request, falling back from the most specific template (e.g. category-news.php) down to the universal fallback: index.php.
front-page.php always holds the absolute highest priority for the root domain, regardless of whether the site displays latest posts or a static page.
get_template_directory_uri() always resolves to the Parent Theme directory path. get_stylesheet_directory_uri() resolves to the active Child Theme directory path.
wp_head() triggers the wp_head action hook right before </head>, allowing plugins to enqueue CSS, meta tags, and analytics. wp_footer() triggers wp_footer before </body>, allowing scripts to execute. Without them, plugins break and the admin bar vanishes.
Never hardcode <link> or <script> tags into header.php! Always register and enqueue them using wp_enqueue_style() and wp_enqueue_script() hooked into the wp_enqueue_scripts action hook.
query_posts() is a deprecated, destructive function that overwrites the main global loop, causes pagination bugs, and runs duplicate SQL queries. new WP_Query() is the official, non-destructive class used to instantiate secondary custom loops safely.
It restores the global $post object back to the main query's current post. You MUST call it immediately after completing a secondary WP_Query loop; otherwise, subsequent template tags and sidebar widgets will output incorrect post data.
FSE is the modern WordPress 6.x paradigm that allows complete visual editing of headers, footers, page templates, and global styling using Block Themes, HTML block templates (in /templates/), and a central theme.json configuration file without writing PHP.
theme.json is the single source of truth for a block theme's design system. It defines color palettes, typography scales, spacing, and generates CSS Custom Properties (variables) automatically across both frontend and editor canvases.
An Action Hook (do_action / add_action) triggers a custom task or event at a specific lifecycle point; it does NOT return a value. A Filter Hook (apply_filters / add_filter) intercepts existing data, modifies it, and MUST ALWAYS return the modified value.
The variable is converted to NULL (empty blankness). If hooked to the_content, all blog post body text across the website disappears!
You use register_post_type($slug, $args) hooked into the init action hook. Crucially, set 'show_in_rest' => true to enable modern Gutenberg block editor support.
Because WordPress caches its rewrite rules in the database. When a new CPT is added, the rewrite rules must be flushed by visiting Settings > Permalinks and clicking "Save Changes", or programmatically via flush_rewrite_rules().
Hierarchical taxonomies (like Categories) support parent/child nested relationships. Non-hierarchical taxonomies (like Tags) are flat, independent keyword labels.
$wpdb is the global database abstraction class instance. To prevent SQL Injection, developers must NEVER concatenate variables directly into SQL queries; always wrap queries in $wpdb->prepare() using type placeholders (%s, %d, %f).
A Nonce (Number used Once) is a cryptographic verification token used to protect forms and AJAX requests against Cross-Site Request Forgery (CSRF) attacks, verified via wp_verify_nonce() or check_admin_referer().
Use register_rest_route('namespace/v1', '/route', $args) hooked into the rest_api_init action hook. Always define a 'permission_callback' to prevent security notices.
Headless WordPress is a decoupled architecture where WordPress functions solely as a backend content repository exposing data via REST API or WPGraphQL, while a modern frontend framework (like Next.js or React) renders the user interface on edge CDNs.
WP-CLI is the official command-line interface for WordPress. It enables developers to perform administrative operations (plugin updates, database exports, serialized search-replace) via terminal shell scripts without opening a browser.
Because WordPress stores complex widget settings and plugin options as PHP Serialized Strings with exact byte-length counters (e.g. s:14:"localhost:8888"). Changing the string length without updating the counter breaks PHP unserialization. Always use wp search-replace, which handles serialization safely.
Core Web Vitals are real-world performance metrics incorporating LCP (Largest Contentful Paint ≤ 2.5s), INP (Interaction to Next Paint ≤ 200ms), and CLS (Cumulative Layout Shift ≤ 0.1). Google enforces them as confirmed search ranking signals.
Page Caching (WP Rocket, LiteSpeed) saves pre-rendered static HTML files to bypass PHP execution entirely. Object Caching (Redis, Memcached) stores individual database query results in server RAM to speed up dynamic PHP execution.
XML-RPC is an obsolete remote API frequently exploited by botnets to execute amplified brute-force attacks and DDoS reflection attacks. Modern applications use the secure REST API.
Enforcing Two-Factor Authentication (2FA) with time-based one-time passwords (TOTP), which blocks automated attacks even if passwords are breached.
Expand your CMS mastery by studying these tightly integrated WordPress development topics:
Solidify interview concepts through practical coding exercises.
Targeted university syllabus questions for computer science students.
Turn your WordPress technical skills into high-paying client projects.
A handy quick reference for technical interviews and coding exams.