WordPress Interview Questions & Answers

Here, you will find Top WordPress Interview Questions and Answers.

These WordPress interview questions are helpful for freshers (beginners) as well as experienced job seekers.

WordPress interview questions are related to functions, admin panel, file structure, database, themes, plugins, actions, filters along with examples.

What is WordPress?

WordPress is web software you can use to create a beautiful website or blog. We like to say that WordPress is both free and priceless at the same time.

Source: https://wordpress.org/

WordPress is an Open Source project, which means there are hundreds of people all over the world working on it. (More than most commercial platforms.) It also means you are free to use it for anything from your recipe site to a Fortune 500 web site without paying anyone a license fee and a number of other important freedoms.


In what year did WordPress come out?

WordPress is a free CMS (Content Management System) came in 2003.


How many default tables in WordPress database?

There are 12 default database tables in WordPress database as given below:

  • wp_options
  • wp_users
  • wp_links
  • wp_commentmeta
  • wp_term_relationships
  • wp_postmeta
  • wp_posts
  • wp_term_taxonomy
  • wp_usermeta
  • Wp_terms
  • wp_termsmeta
  • wp_comments

Note: “wp_” is the default prefix but you can change it with another name.


Where is the WordPress content stored?

WordPress content is stored in the MySQL database on the Server.


What is default table prefix for WordPress database?

wp_ is the default table prefix for WordPress database.
See the list of WordPress Database Tables.


What are the Popular plugins in WordPress for SEO?

Here are the most popular SEO plugins for WordPress.

  • Yoast SEO
  • All in One SEO Packs
  • The SEO Framework

What are commonly used WordPress theme functions?

There are many built-in WordPress functions that we use in theme customization. Here are some of the mostly used WordPress theme functions:

  • get_template_directory_uri() – Retrieve template directory URI for the current theme. In the event that a child theme is being used, the parent theme directory URI will be returned. Use get_stylesheet_directory_uri() to include resources that are intended to be included in/overridden by the child theme.
  • wp_head() – The wp_head action hook is triggered within the & section. You use this hook by having your function echo output to the browser in HTML head. Most of default actions into the ‘wp-head’ hook by WordPress core. You might use it to include your own js/css and other meta into the WordPress.
  • wp_nav_menu() – Displays a navigation menu created in the Appearance → Menus panel. For example: ‘Project Nav’ )); ?>
  • home_url()- The home_url template tag retrieves the home URL for the current site
  • e_()- Displays the returned translated text from translate()
  • get_sidebar() - Includes the sidebar.php template file from your current theme’s directory.
  • get_header()- Includes the header.php template file from your current theme’s directory.
  • wp_link_pages()- Displays page-links for paginated posts (Next page & Previous Page)
  • edit_post_link()- display link to edit current post from dashboard

Describe WordPress files and directory structure

Here is the list of important WordPress files & directory structure:

WordPress Root/

  • wp-admin/
    • css/
    • images/
    • other core PHP files…
  • wp-content/
    • plugins
    • themes
    • uploads
    • upgrade
  • wp-includes/
    • css/
    • images/
    • other core PHP files…
  • .htaccess
  • wp-config.php
  • wp-blog-header.php
  • other core PHP files

How to limit WordPress Post content length?

Sometimes, we only want to show initial WordPress post content on the site. There are many ways to limit the WordPress post content length. One way is to replace WordPress the_content() in WordPress template files with following code.


Explanation:

get_the_content() function contains wordpress content page/post content. Then it will pass it to php substr() function to limit the content to 300 characters. Then you can display wherever you want.


Which function is used to get home URL in WordPress?

get_home_url(); and home_url();functions is used to get home url in WordPress.