Interview FAQ WP Interview FAQ WordPress

This article will cover all the relevant WordPress questions with answers that are frequently asked in an interview from beginners.

What is WordPress?

WordPress is a CMS(Content Management System) that basically is used for making content based websites for example blogs, introduction,law,small corporation etc. Now days WordPress is not just limited to blogs but with WordPress e-commerce, social platforms, forums can also be build.

How many tables are there in WordPress database?

12

What is theme?

A WordPress Theme is a collection of template and style sheets. In WordPress Dashboard WordPress themes are in Appearance–> Themes . You can change any theme from here. WordPress has default theme also.

What is a plugin?

Plugin is a collection of function that enhance the functionality of WordPress. For Example contact form 7 plugin can be used to add form to WordPress.

Name any WordPress functions?

get_stylesheet_directory_uri(): Get the path of current theme stylesheet directory.

get_template_directory_uri(): get the path of theme

get_bloginfo(): To get the site title,description,url,version,stylesheet_url etc.

get_the_date(): Returns the date .

body_class(): List the classes for wordpress website.

get_header() : include header file

get_footer(): include footer file

get_sidebar(): include sidebar file

What are hooks?

Hooks are basically a piece of code that interact with another piece of code. In WordPress hooks can be used with actions and filters.

What are actions in WordPress? How they are differ from filter??

Actions are used to change the default functionality of theme or plugin.Actions are used to change the execution of WordPress at a specific point or event. For example in WordPress when the site is loaded, plugin loaded, user visits the site, menu sidebar etc created.

Actions are called within the do_action() functions. For adding actions add_action is used.

Name some action of WordPress? Give some example of actions?

wp_head() : load the scripts in head tag

wp_footer() : load the scripts in footer tag.

admin_init() : initial hook that triggered before any hook when user access the admin area.

save_post(): When page or post is saved.

get_footer() : when footer.php is called

get_header(): when header.php is called.

add_meta_box(): runs when edit post page is loaded. It add the meta box to a post.

For more action list , Check here.

What are filters?

Filters are basically used to modify the default functionality of theme or plugin. Filter change the functionality during the execution of WordPress.For example change the WordPress title, modify the WordPress classes using body_class().

Name some filters in WordPress that are mostly used?

body_class() to get the list of class

get_the_excerpt(): to get the excerpt of a post

the_content() : get the content of the post.

the_title() : get the title of the page or post

the_permalink() : get the link of post

the_date() : get the date of a post

How many roles for user in WordPress?

Total 6 .

Super Admin : Admin for networking websites

Adminstrator : admin who have accesss to all features of website

Editor : who can have access to publish and manage posts including the post of others also

Author: who can have access only to their own posts

Contributor : can write posts not have permission to publish them.

Subscriber : who can manage only their profile.

What are widgets?

Widgets add content to the sidebar area. They can appear on all website or specific area of a specific page.They are mostly used for creating sidebar,footer or header option.In dashboard you can access it from Appearance > Widgets. widgets can be drag and dropped and place in the widget sidebar area.

For more how to create , remove widgets in dashboard check this article here.

What is permalink? How to get a permalink()?

permalink are WordPress post link. In dashboard Settings > Permalink and permalink can be set via date,post name, month name , numeric or post name. get_permalink() is used to get a permalink of page of post id.

What is htaccess file?

It is configuration file for use on web server for example Apache web server. This file manages the user access. This can be used for

  • Error Handling
  • Password Protection :
  • URL Redirects/ Rewrites
  • Handling MMI Type
  • Enabling SSI
  • IP Blacklist / Whitelist
  • Specify Default Directory

If you are interested in finding more details check this blog.

What is wp-config file?

It is WordPress configuration file and it is located at the root of wordpress installation directory.

Usually it has following details

  • Database Name, Username, Password and host name
  • site URL and home URL
  • Database character set type, database collate type
  • authentication keys
  • error handling
  • table prefix
  • path to wp-setting file

Check wp-config.php file default setting here.

how to migrate a WordPress site?

WordPress site can be migrated via a plugin like Duplicator pro.

Or

  • Step 1: import SQL database
  • import WordPress directory
  • Put WordPress directory files in public_html/www folder
  • open wp-config.php and set the new database username and password here.
  • In SQL tables edit wp_options table and change the site_url and home_url
  • Visit url, login and refresh permalink.
How to display errors in WordPress ? or how to do debugging in WordPress?

To enable error reporting in WordPress

use

define('WP_DEBUG', true); 
define('WP_DEBUG_LOG', true); 
define('WP_DEBUG_DISPLAY', false); 
@ini_set('display_errors', 0); 
Apart from database detail what does wp-config file have?
  • to set directory/file permissions
  • to set language support
  • to define theme and plugin directory urls
  • to set path of upload folder
  • to set maximum number of revisions for a post
  • to manage trash
  • to set memory limit
  • to manage plugin and site updates
  • to manage security settings
How to flush permalinks in wordpress?

Dashboard->settings->permalink-> save

How to add user in WordPress?

Dashboard-> user -> Add New

Can WordPress be used for e-commerce?

Yes. Woo-commerce plugin is widely used for e-commerce websites

What is woo-commerce?

It is a free plugin that is used to create a store on WordPress website. It can be further customize according to the client requirements.

How many products can be stored in woo-commerce?

There is no limitation on number of products that can be stored in woo-commerce.

So, these are some of the basic WordPress interview questions. You can tell what other questions asked from you as a beginner in interview. Also If you find this article useful please leave a comment. Your feedback will be appreciated.

Leave a comment