Experienced WordPress Interview Questions
What is WordPress Multisite?
Multisite is a feature of WordPress that lets you run a network of many sites from one installation. All the sites share the same core files, themes and plugins, but each has its own content, users roles and settings. It is managed by a Super Admin in the Network Admin dashboard.
You turn it on in wp-config.php and then complete the network setup in the dashboard (Tools > Network Setup):
define( 'WP_ALLOW_MULTISITE', true );
- Sub folder sites:
example.com/site1. Sub domain sites:site1.example.com. - Every site has its own tables with a number in the prefix (
wp_2_posts). - Good for schools, big companies and blog networks. Not good when each site needs a different hosting or a very different set of plugins.
What is the difference between a custom post type and a custom taxonomy?
| Point | Custom post type | Custom taxonomy |
|---|---|---|
| What | A new type of content | A new way to group content |
| Example | Book, Movie, Event | Genre, Brand, Location |
| Register with | register_post_type() | register_taxonomy() |
| Stored in | wp_posts (post_type) | wp_terms, wp_term_taxonomy and wp_term_relationships |
| Like | Posts and pages | Categories and tags |
<?php
add_action( 'init', function () {
register_post_type( 'movie', array( 'label' => 'Movies', 'public' => true, 'show_in_rest' => true ) );
register_taxonomy( 'genre', 'movie', array( 'label' => 'Genres', 'hierarchical' => true, 'show_in_rest' => true ) );
} );
$ wp post-type list –name=movie –fields=name,label,public
name label public
movie Movies 1
$ wp taxonomy list –object_type=movie –fields=name,label,hierarchical
name label hierarchical
genre Genres 1
The taxonomy is attached to the post type, so a movie can have a genre. Learn both: Custom Post Types and Custom Taxonomies.
How to add CSS and JavaScript the correct way in WordPress?
Never add <link> or <script> tags directly in header.php. Register them with enqueue functions, so WordPress can manage the order, the dependencies and the duplicates.
add_action( 'wp_enqueue_scripts', function () {
wp_enqueue_style( 'my-style', get_stylesheet_uri(), array(), '1.0' );
wp_enqueue_script( 'my-script', get_template_directory_uri() . '/js/main.js', array( 'jquery' ), '1.0', true );
} );
- The hook for the front end is
wp_enqueue_scripts. For the dashboard it isadmin_enqueue_scripts. - The 3rd parameter is the list of dependencies. The 4th is the version (cache busting). The last parameter of the script is
trueto load it in the footer. - Use
wp_add_inline_script()to pass PHP data to your script.
Read the tested example in Enqueue Scripts and Styles.
How to secure a WordPress website?
- Keep the core, themes and plugins updated, and delete the ones you do not use.
- Use strong and different passwords, and two factor login for admins.
- Give each user the lowest role needed.
- Use HTTPS and the latest supported PHP version.
- Limit the login attempts, and do not use the username
admin. - Turn off the file editor:
define( 'DISALLOW_FILE_EDIT', true );. - Set the correct file permissions (755 folders, 644 files, 600 or 640 for
wp-config.php). - Take regular backups and test the restore.
- Download plugins and themes only from trusted places, and never use nulled ones.
- Use a security plugin or a firewall for scans and brute force protection.
You can check if your core files are changed:
$ wp core verify-checksums
Success: WordPress installation verifies against checksums.
More in WordPress Security.
What is new in WordPress 7.0?
WordPress 7.0 (“Armstrong”) was released on 20 May 2026. The main things in this release are:
- AI foundations: an AI Client (one interface to talk to AI providers) and the Abilities API, with which plugins describe what they can do. WordPress itself does not include an AI model, you connect your own provider.
- Connectors: a new screen at Settings > Connectors to manage connections to external services such as AI providers.
- A refreshed admin design, and new blocks (like Breadcrumbs).
- Better revisions and editing tools in the editor.
- PHP 7.4 is the minimum version now. WordPress.org recommends PHP 8.3 or newer.
The headline feature real time collaboration was planned, but it was taken out of the release before the launch. You can check some of the new parts on a real WordPress 7.1 site (7.1 is the current version at the time of writing):
$ wp eval 'echo WP_Block_Type_Registry::get_instance()->is_registered( "core/breadcrumbs" ) ? "Breadcrumbs block: yes" : "no";'
Breadcrumbs block: yes
$ curl -s http://example.com/wp-json/ | jq -c '.namespaces'
["oembed/1.0","wp/v2","wp-site-health/v1","wp-block-editor/v1","wp-abilities/v1"]
The wp-abilities/v1 namespace in the REST API is the Abilities API. Always read the official release notes on wordpress.org before an update.
How to move a WordPress site to a new domain or server?
- Take a full backup (database and
wp-content). - Copy the files to the new server, and import the database there.
- Edit
wp-config.phpwith the new database name, user, password and host. - Replace the old domain with the new one in the database. Use WP-CLI, because it handles serialized data:
- Save Settings > Permalinks again, check the images and links, and set up 301 redirects from the old URLs.
$ wp post create –post_title="Link test" –post_content='<a href="http://example.com/about/">About</a>' –post_status=publish –porcelain
5
$ wp search-replace 'http://example.com' 'https://new-example.com' –dry-run –skip-columns=guid –report-changed-only
Table Column Replacements Type
wp_options option_value 2 PHP
wp_posts post_content 3 SQL
wp_users user_url 1 SQL
Success: 6 replacements to be made.
Remove --dry-run when you are happy with the report. Never use a plain SQL REPLACE on the database, because the values saved with serialize() will break. See WP-CLI and Backup and Update.
What is a must-use plugin (mu-plugin) in WordPress?
A must-use plugin (mu-plugin) is a PHP file placed in wp-content/mu-plugins. WordPress loads it automatically, before the normal plugins. You cannot deactivate it from the Plugins screen, and it has no activation or update steps.
<?php
/**
* Plugin Name: TC Must Use Demo
*/
add_filter( 'the_title', function ( $title ) {
return $title . ' *';
} );
$ wp plugin list –status=must-use –fields=name,status
name status
tc-mu must-use
$ curl -s http://example.com/hello-world/ | grep -o "<title>[^<]*"
<title>Hello world! – Demo Site
- Files in sub folders are not loaded automatically, you need a loader file.
- Use it for code that must always run: site wide rules, security checks or hosting features.
- The folder does not exist by default, you create it.
What is WP-CLI?
WP-CLI is the official command line interface for WordPress. Many dashboard actions can be done with one command, so it is faster and good for scripts and many sites.
$ wp core version
7.1.4
$ wp plugin list –fields=name,status
name status
akismet inactive
hello inactive
$ wp user list –fields=ID,user_login,roles
ID user_login roles
1 admin administrator
$ wp option get blogname
Demo Site
- Install and update the core, plugins and themes.
- Create posts, users, menus and terms.
- Export and import the database (
wp db export), and runwp search-replace. - Run PHP code with
wp evalandwp eval-file.
Learn more in WP-CLI Tutorial.
- « Previous
- 1
- 2