Loading…
WordPress Interview Questions

An Overview of WordPress

WordPress the most popular content management system (CMS) in the world. We have an impressive collection of WordPress Interview Questions that is a must-read for all developers and designers!. It is a web application that allows website managers to manage their website and publish content even if they do not have any programming knowledge. WordPress uses PHP and MySQL, which are supported by most of the web hosts.

About WordPress
What is WordPress It is a web application that allows website managers to manage their website and publish content even if they do not have any programming knowledge.
Latest Version 5.2.2, released on June 18, 2019
Created By Matt Mullenweg
Written in PHP
WordPress License GNU Public License
Official Website https://wordpress.org/

Development History

The first version of WordPress (WordPress 1.0) was released by two developers - Matt Mullenweg and Mike Littlein, in January 2004.

Though every interview is different, we can help you crack your next interview with the most commonly asked WordPress Interview Questions, which will help you achieve success.

Advantages

  • Intuitive and user-friendly interface
  • Open-source and free for everyone to use
  • Easy to install and update
  • Helpful community

If you are looking for an opportunity to move ahead in your career as a WordPress developer or if you are looking for Wordpress Interview Questions and Answers for Freshers or Experienced that can help you crack your interview.

WordPress Installation Steps

  • Download and unzip the WordPress package.
  • Create a database for WordPress on your server, as well as a MySQL user who will have access and modify rights.
  • This step is optional. Find and rename wp-config-sample.php to wp-config.php. Now edit the file and add your database information.
  • Upload your WordPress files to the desired location on the server. If you want to integrate WordPress into your domain, move all contents of the WordPress directory into the root directory of your server.
  • If you want to have WordPress installation in its subdirectory on your website, create the blog directory on the server and upload contents to the list via FTP.

We have a separate blog for How to Install WordPress. You can check it.

Last update: 30 Jul 2019, 78 Questions and Answers

WordPress Interview Questions and answers

Looking for a new job? Do not miss to read our WordPress Interview Questions and answers. Whether you are a fresher or an experienced, these questions and answers that can help you to crack your interview.

It is a web application that allows website managers to manage their website and publish content even if they do not have any programming knowledge. WordPress uses PHP and MySQL, which are supported by most of the web hosts. A WordPress site can be build into an e-commerce store, newspaper website, portfolio, etc.

4 0

The latest version of wordpress is 5.2 Beta 1 and it is released in April 12, 2019.

1 1
  • Download and unzip the latest WordPress from its official website.
  • Create database for WordPress
  • Find and rename wp-config-sample.php to wp-config.php, then add your database information.
  • Upload the WordPress files on your web server
  • Run the URL in browser
  • Set the basic informations like site title, username and password after that you can use this.

We have a separate blog for How to Install WordPress. You can Check it.

1 0

There are altogether 11 tables by default in WordPress.

  • wp_options
  • wp_users
  • wp_links
  • wp_commentmeta
  • wp_term_relationships
  • wp_postmeta
  • wp_posts
  • wp_term_taxonomy
  • wp_usermeta
  • wp_terms
  • wp_comments
3 1

We can create templates for various purpose like if we want to make a different layout rather than a home page or if we want to display custom posts types like news than we can create a template and merely display all news there.

Steps to create template in wordpress themes.
  • Create a news.php file on root in theme folder.
  • Insert get_header(); and get_footer(); in news.php page
  • Add <?php /* Template Name: News Template */ ?> in top of this created page. Now this template name is "News Template".
3 0

You can use get_post_meta(get_the_ID(), 'custom_field_name', TRUE);

// custom_field_name is field name.

0 0

We can do it 2 ways

  • Before installation : Go to wp_config.php file and rename $table_prefix = 'wp_'; whatever you want.
  • After installation : Go to phpmyadmin -> select your databse -> check all tables -> Add/Update table prefix.
3 1

It is provided by WordPress to allow your plugin to ' hook into' the whole WordPress; that is, to call functions in the plugin at particular times according to your need and thereby set your plugin in motion.

There are two kinds of hooks:

  • Actions hook
  • Filters hook
1 0
1. Actions Hook

Actions Hook are triggered by particular events that take place in WordPress such as changing themes, publishing a post, or displaying an administration screen. It is a custom PHP function defined in your plugin and hooked, i.e., set to respond, to some of these events.

 

Actions offently do one or more of the following things

  • Modify database data
  • Send an email message
  • Modify the generated administration screen or front end page sent to a user web browser.

 

Here are some Actions Functions listed

  • has_action()
  • do_action()
  • add_action()
  • remove_action() etc
 
2. Filters Hook

Filters Hook are functions that WordPress passes data through, at certain points in execution, just before taking some action with the data. It sits between the database and the browser and between the browser and the database; all most all input and output in WordPress pass through at least one filter hook.

 

The necessary steps to add your filters to WordPress are listed:

  • Create the PHP function that filters the data
  • Hook to the screen in WordPress, by calling add_filter()
  • Put your PHP function in a plugin file and activate it.

 

Here are some Filters Functions listed

  • has_filter()
  • doing_filter()
  • add_filter()
  • remove_filter() etc
2 0

We can make many types of user types of role.

  • Administrator Role
  • Author Role
  • Editor Role
  • Subscriber Role
  • Contributor Role
3 0
Here are some practical ways:
  • Use a unique username and password
  • Use precautions against Brute force
  • Keep the versions, plugins, and themes updated.
  • Prevent from viruses and malware.
  • Also you can use wordpress security plugins
0 0

$args = array( 'post_type' => 'blog', 'posts_per_page' => 10 );
$loop = new WP_Query( $args );
while ( $loop->have_posts() ) : $loop->the_post();
   the_title();
   echo '<div class="entry-content">';
     the_content();
   echo '</div>';
endwhile;

0 0

Custom posts types in WordPress are the new post types that developers can create. You can add a custom post type via the register_post_type() function, which allows the developers to define the new post type by labels, features, and availability.

Or we can also create custom post type with the helps of plugins.

  • Custom Post Type UI
  • Custom Field
1 0

Shortcodes in WordPress are specific codes that allow the developers to do various tasks with minimal effort. Shortcodes are used to simplify tasks such as creating objects or embedding files that require lots of coding in a single line. A Shortcode is synonymous to the shortcut. WordPress has five built-in shortcodes- audio, embed, caption, video, and gallery.

Example

                                                    

1. You can call shortcode function like this :
echo do_shortcode('[display_related_posts]');

2. In your function.php you can make
function display_related_posts($array = array()) {
      return 'BestInterviewQuestion.com';
}
add_shortcode('display_related_posts', 'display_related_posts');

1 0
Example

Suppose, we have a table "wp_states", we want to display all state where status = 1

$qry = "SELECT title FROM wp_states where status = 1;
$states = $wpdb->get_results( $qry );
foreach( $states as $row ) {
   // Display here state name by
   $row ->title
}

0 1

The extension of any parent theme present in WordPress is defined as a child theme. Any update to undo the changes in child theme, if we make changes to the parent theme. While developers work on a child theme, the customizations and changes will be preserved on an update.

0 0

To enable debug mode in WordPress, developers have to edit the wp-config.php file and change the WP_DEBUG constant value to true condition.

0 0

The template tags are basically PHP functions used to display dynamic information or customized blog template. Here is a list of some of the generally used template tags in WordPress.

Different template tags in WordPress
  • wp_register()
  • get_header()
  • wp_title()
  • get_sidebar()
  • get_the_author()
  • wp_enqueue_script()
  • category_description()
  • wp_list_authors()
  • get_bookmarks()
0 0

As MySQL is widely available server available globally and extremely fast, it will be the convenient to be used with WordPress. MySQL is also open source and available with zero cost. It also supports numerous low-cost Linux hosts, that’s why using MySQL, hosting website is easy here.

0 0

Yes, WordPress does have cookies. It used cookies for the verification process of users while logging in.

0 0

There are three ways to back up a WordPress website thoroughly.

1. Backup Through Hosting

Hosting providers offer service that completes daily, complete backups to your WordPress website.

2. Backup Files Manually

We have to download the entire WordPress directory via cPanel or SFTP program. We can also use WordPress database to backup website data manually.

3. Automated Backup with Plugins

There are many secure and easy to use WordPress backup plugins available for your use. Just install, configure few settings and you are ready to go. Few of them are: BackupBuddy Premium, BackWPup Free WordPress Plugin, Duplicator Free WordPress Plugin, UpdraftPlus Backup and Restoration Free WordPress Plugin, WordPress Backup to Dropbox Free WordPress Plugin, etc.

0 0

You can use wordpress like a CMS not Framework. If you want to use as CMS or managing blog system then no one can beat Wordpress but if we want to develop a customized system then we have to use Framework.

Here are some limitation of wordpress.

  • Difficulty in customization.
  • Not easy to database migration with other CMS or Frameworks.
  • WordPress and Plugins needs frequent updates
  • Not Secure
  • It can be expensive
  • Not so SEO friendly
  • In WordPress Customization needs Coding etc
1 0

WordPress was released on 27 May 2003

1 1

A theme in WordPress is a collection of files that work together to produce a graphical interface with an underlying unifying design for web pages. These files are called template files and theme modifies the way the site is displayed, without changing the core files. It includes image files, customized template files, style sheets, custom Pages. etc

Themes are located in the Administration Screen > Appearance > Themes as additional selections.

1 0

WordPress plugins are a type of apps that allow you to add more functionality and features to your WordPress website just like the same way as apps do for your smartphone. Plugins allow you to create any types of the site with WordPress, not just blogs. Nowadays plugins are very popular.

There are lots of plugins are available that listed below:-
  • Yoast SEO Plugin (This plugins are used for SEO purpose.)
  • Contact Form 7 (This plugins is used to make web forms with any code)
  • Sitemap & URLs Plugins
  • All In One WP Security & Firewall etc
Advantages of WordPress Plugins
  • Helps in SEO
  • Ease Of Use and Quick Installation Process
  • It helps in to Keep Secure
  • Strong Community Support
  • Helps to use advanced features of WordPress
1 0

To make your static page as a front page you have to follow these steps

  • Goto Admin Panel
  • Select "A Static Page"
  • Choose you page from "Front page" section
  • Now your selected page from Front Page is set default front page.

 

 

1 0

WordPress is the best CMS in the world because of its features and advantages. It offers an open source environment which makes it completely free to manage and install.

There are many reasons why WordPress is considered the best CMS. Some of them are listed below:

  • Available huge Themes and Plugins
  • SEO Friendliness and Security
  • Open source and Free of Cost
  • A large community of developers and users
  • Inbuilt Admin User Interface and its Speed
1 0

To install latest wordpress version 5.2, our server should supports below requirements.

  • PHP 7.3 or greater
  • MySQL 5.6 OR MariaDB 10.0 or greater
  • (Optional) Apache mod_rewrite module
  • Recommend either Apache or Nginx as the most robust

We have a separate blog for What is the minimum requirement to run WordPress. You can Check it

0 0

In WordPress, Posts is a dynamic entity that has a published or updated date and is displayed on the blog page.

Example: news, events etc

Pages do not have published or updated date. Hence there are useful for the static and timeless type of content.

Example, the “About Us” or “Contact Us”

The difference between pages and posts is that the WordPress page is a static entity and post is a dynamic entity.

0 0
  • Goto admin panel -> setting -> click on the Discussion tab
  • Under Default article settings uncheck the box next to Allow people to post comments on new articles
  • Now click on Save Setting
0 0

This function is used by developers to retrieve the metadata of users. The usermeta function is capable to return an array or single metadata. The following syntax needs to be used to apply usermeta function.

get_user_meta( int $user_id, string $key = '', bool $single = false )

0 0

Avatar or Gravatar is an icon or representation of a user in a shared virtual reality, such as chat, forum, website or any other form of online community in which the user wants to have something to distinguish themselves from other users.

It usually an 80px by 80px image that the user will create by ownself.

0 0

A category is one of the predefined taxonomies in WordPress, and it is used to sort and group content into different sections. In new WordPress installation, "Uncategorized" is the default category. We can change the default category from Settings -> Writing screen. In WordPress post can be filed under many categories and can have both tags and categories.

For Example

 

2 0

A tag is one of the pre-defined taxonomy in WordPress. You can add tags to posts along with categories in WordPress. Tags are smaller in scope and focused on specific topics.

1 0

To change the default length of the excerpt in WordPress, we have to insert the below-mentioned syntax to the functions.php file and edit the amount of the words that we desire to be displayed in our excerpts.

add_filter( 'excerpt_length', function($length) {
    return X;
} );

Here above X is the number of words to be displayed.

0 1

 

In WordPress categories are hierarchical which means terms can have a relationship with each other like child and parent.
Example: You could have a Category called India, and under India you could have categories called Delhi, Haryan, and U.P. Categories means for broad grouping of posts.

But Tags are NOT hierarchical which means no relationship between them. Tags means to describe specific details posts.

1 0

The quickest way to install plugins on WordPress is through plugin search.

Here are the steps:
  • On the admin page of your site, click "Plugins," and "Add New."
  • Search for plugins by typing the name or functionality.
  • You may see a couple of listings
  • Just select the plugin that you want and click ‘Install Now.’
  • WordPress will download and install the selected plugin.
1 0

There are two ways to update your WordPress - one-click update and manual update.

1. One-click update: All versions of WordPress from 2.7 onwards have this feature. You can update by going to Dashboard and clicking "Updates" screen. On "Update WordPress," click "Update Now" for initiating the process.

2. Manual Update: Here are the steps:

  • Replace your WordPress files
  • Download and unpack the latest zip file.
  • Deactivate plugins and delete old wp-includes and wp-admin directories on your host.
  • Using FTP, upload new wp-includes and wp-admin directories.
  • Upload individual files from a new wp-content folder, and overwrite existing files. Do NOT delete existing wp-content folder or files and folders in the current wp-content directory.
  • Next, upload new files from the root directory of the latest version to your current directory.
0 0

Here are the steps:

  • In login dashboard, click "Appearance" "Theme" and "Add New."
  • On the top of your screen, click “Upload.” Click “Browse,” and select.ZIP file for a downloaded extension.
0 0

Custom fields are metadata used to include additional information about a post or page, like author name, title, date and time, etc. By default, the custom fields option in WordPress is hidden on the "edit" screen. If you want to see it, click ‘Screen Options’ at the top and enable "custom fields."

0 0

wp-config.php is the most important file in WordPress installation. It links the database and files on your WordPress site together. Located in the root of WordPress file directory, wp-config.php contains configuration details, including database connection information.

0 0

Taxonomies in WordPress are used to group posts and post types together. Custom taxonomies can help developers create groups and bring them under one head.

There are 4 in-built taxonomies in WordPress- Category, Tag, Link Category, and Post Formats.

0 0

A WordPress site is like any other website or application and has security threats. In order to strengthen your WordPress’s security, you can consider implementing a Secure Socket Layer (SSL) certificate.

0 0

In WordPress, Widgets are small blocks that perform specific functions. Different types of widgets are available in sidebars. Originally, widgets were designed to provide an easy way to design and structure the WordPress theme.

0 0

The functions.php file in WordPress behaves like a plugin by adding features and functionalities to your site. Developers can use functions.php to call functions and to define their own functions. While each theme in WordPress includes its own functions file, but the code in the active theme’s functions.php file is run.

0 0

While there are different ways to add Google Analytics your WordPress site, here are the 3 most common ones:

  • Through MonsterInsights
  • By inserting plugins for Headers and Footers
  • By installing Google Analytics in the WordPress Theme
0 0

After registering your menus, use wp_nav_menu() to inform your theme where to display your menus. You can add this code to a header.php file for displaying the registered header-menu:
wp_nav_menu( array( 'theme_location' => 'header-menu' ) );

Example

                                                    

wp_nav_menu( array $args = array(
   'menu' => "",
   'menu_class' => "",
   'menu_id' => "",
   'container' => "",
   'container_class' => "",
   'container_id' => "",
   'fallback_cb' => "",
   'before' => "",
   'after' => "",
   'link_before' => "",
   'link_after' => "",
   'echo' => "",
   'depth' => "",
   'walker' => "",
   'theme_location' => "",
   'items_wrap' => "",
   'item_spacing' => "",
) );
// These are the parameters od this function.

0 0

For creating a static page in WordPress, follow these steps:

  • Go to WordPress Admin Panel
  • Create Front Page by selecting "Add New Page."
  • Name it "Home."
  • Add content to the content area of the static page.
  • Publish it.
1 0

For creating a WordPress Page, follow these steps:

  • In your WordPress Dashboard Navigation menu, click "Pages" and select "Add new."
  • Add page title
  • Add content.
  • "Page Attributes" section can apply parent page or specific template to this new page.
  • "Template" section will allow you to apply any template to the new page.
  • "Order box" helps you arrange your page numerically.
  • Preview the page. Hit "Publish."
0 0

WordPress is dynamic. This is because nearly everything in WordPress, including Pages, is generated dynamically.

1 0
  • Login to WordPress admin area
  • If editing a Post, Click "Post" and then click "All Posts." Find the Post you want to edit and make changes. Click Publish.
  • If editing a page, Click "Pages" in left column menu, and click "All Pages." Find the page you want to update and make changes. Click Publish.
1 0

With the method is_plugin_active() we can check any particular plugin is active or not.

How to check

include_once( ABSPATH . 'wp-admin/includes/plugin.php' );

// check plugin using plugin name
if ( is_plugin_active( 'plugin-directory/plugin-file.php' ) ) {
   // Activated
}

0 0

Here are the Steps to get your WordPress site on Google:

  • Click Settings. Go to the Reading page, and scroll down to Search Engine Visibility option. Check your settings.
  • Install Yoast SEO Plugin.
  • Connect Google Search Console with your site. To do this, click "Add Property" in your Google search console account. Add your website's URL in the website field.
  • Set up XML sitemaps. Go to the SEO menu in the left column, and click "General page." Click "Features." Scroll down to the "XML sitemaps" and enable it.
  • Submit XML Sitemaps on Google Search Console by logging into your Google search console account and selecting your website.
0 0

Here is a list of crucial rules that require to be followed by the developers while developing a WordPress plugin:

  • Unique user name creation
  • Plugin folder creation
  • Creation of sub-folder for PHP files, assets, and translations.
  • Activation and deactivation function creation
  • The main plugin file creation and fill the header information
  • Script for uninstall creation.
  • readme.txt file creation
  • Use of proper functions and constants to detect paths of the plugin file.
0 0

Yes, we can rename the WordPress folder. If WordPress is already installed in our device, we have to log in to the weblog as the administrator and the change the required settings mentioned below.

  • WordPress address (URI)
  • Blog address( URI)

After the changes, we can rename the folder or directory with the use of the WordPress file in it.

0 0
Users won't be able to see the plugin menu when their blog is hosted on free wordpress.com as it’s limited with plugin uses. Even the users without an account of administrator-level won’t be able to use the plugin menu.
0 0

Users have to first ensure that whether the themes they are using support the widget they are wishing to add. In some cases, the problem may occur when the function.php or file similar to that is missing. There are chances also this could happen if the user forgets to save the changes made in the widget or to refresh the older page display.

0 0

When developers paste the website code in wrong formats, they will be locked out of the WordPress admin and the website will be displayed as blank. The similar scenario will happen if we paste the code in an incorrect location or when our IP is banned.

0 0

You can display current page title by get_the_title()

0 0

It is a type of action hook where the code is dynamically added to a theme in between head tag.

Example

                                                    

<head>  
    <?php wp_head(); ?>
</head>

0 0

You we use get_the_post_thumbnail_url(); . You can use this inside loop or outside loop. If you are using this outside of loop then you have to pass post ID otherwise its optional in case inside loop.

0 0
We can use simplay WP_Query() with post_parent and post_type, then we can get all child pages of that particular parent page.

Example

                                                    

$my_query = new WP_Query(array(
    'order' => 'ASC',
    'orderby' => 'menu_order',
    'post_parent' => 13,
    'post_type' => 'page',
));
if($my_query->have_posts())
{
    while($my_query->have_posts())
       {
          // display your required things
       }
}

 

0 0
Ask Question