WordPress Interview Questions & Answers

02nd, January 2014 By

1. what is WordPress.

WordPress is CMS(Content Management System) based on php and mysql.Its free and open source blogging tool.The world aproximately 22% websites used wordpress.Its now most popular blogging tool on internet network.

The main reason for its popularity is its admin very easy to use and manage.Its will work on apr. 60 million websites world wide.

2. Who and when developed wordpress.

The Matt Mullenweg and Mike Little is founder of wordpress.Its first release in 27 May 2003.The first version released is 0.7.

3. What is current version of wordpress.

The wordpress 3.5.1 version released on 24 January 2013.

4. What are the features of wordpress.

1. Simplicity,Make wordpress to manage easily that is its very easy to use.

2. Free open source ,its free to use wordpress.

3. Easy theme system,In wordpress we have thousand of good free theme to use.

4. Extends with plugins, we can extends the functionality of wordpress using thousands of free plugins or will create any plugin according to your requirements.

5. Community,WordPress has vibrant and supportive community.

6. Multilingual, wordpress is available on more than 70 languages.

7. Flexibility, with wordpress you will create any type of blog or website.

8. Comment, the built in comment system also make wordpress popular as you can comment your views on website.

9. Easy installation and upgrades.

10. Full standards compliance,XML-RPC interface,Easy Importing,Cross-blog communication tools.

5. How many tables by default have wordpress .

By default wordpress have 11 tables.

1. wp_posts

2. wp_commentmeta

3. wp_comments

4. wp_links

5. wp_options

6. wp_postmeta

7. wp_terms

8. wp_term_relationships

9. wp_term_taxonomy



6. What is the prefix of wordpress tables by default.

By default, wp_ is prefix of wordpress.

7. Can the website on WordPress is secure.

WordPress website is secure. Installing WordPress is just basic to set up but we have to make various steps to make it secure. We can use various plugins etc to make it secure from any hack. There is myth that WordPress website are not secure.I have worked on lot of websites on WordPress and not faced any issue of hacking.So consider the WordPress is secure content management system to use.

8. How you will pass a variable by value in WordPress.

Its same like we will work in c,

$a = &$b

9. How can you backup or import your WordPress content from admin panel.

For import content from wordpress admin panel goes to:-

WordPress admin -> Tools -> Import

This will create a xml file for your posts ,comments, category etc.

10. Tell some commonly used functions in wordpress.

WordPress have lot of inbuilt functions.Some of commonly used function in wordpress are:-

1. wp_nav_menu() :- Displays a navigation menu created in wordpres admin menu.

2. is_page() :- Condition for check if page is displayed. Its return true or false.

3. get_excerpt() :- Displays the excerpt of the current post with read more link for display full post.

4. is_category() :- Condition for check if category is displayed. Its return true or false.

5. the_title():- Displays the title of the current post

6. the_content():- Displays the contents of the current post.

12. How to use shortcodes in WordPress template.

 <?php echo do_shortcode('[Your Shortcode]'); ?> 

13. What are hooks in wordpress.

WordPress hooks are allow user to modify wordpress theme or plugin with short code or add their own code without change the original files.There are two types of hooks as action and filter.

Action Hooks :- Action hooks are points in wordpress core where its possible for outside resources to insert additional code.

For example- wp_head() , the_post(),get_sidebar() is an action hook which is used by most of themes.To hook an action ,create an hook in your function file and hook it using add_action() function.


add_action( 'wp_head', 'webs_expert' );

function webs_expeert () {

echo "&lt;div&gt;This is test&lt;/div&gt;";



Filter Hooks :- Filter hooks are used to handle output.like using it you will add an text or content at end of content of your post.You will add an filter using add_filter() function.There are various filter used in wordpress as the_title() ,wp_title() ,get_the_excerpt(),get_to_ping() ,attachment_icon().

For example:- Using these filter we will add content add end of posts.

<?php     add_filter( 'the_content', 'webs_expert' );

function webs_expert( $content ) {

if ( is_single() ) {

$content .= '&lt;div&gt;This is test&lt;/div&gt;' . " ";


return $content;



14. What is file structure in wordpress.

The main files used in wordpres are:-

1. index.php or home.php :- for home page or index page.

2. single.php :- for single post page.

3. page.php :- display the static pages.

4. category.php :- Display the category page.

5. archive.php :- For archive page display.

6. tag.php :- For display the tags page.

7. author.php :- For dispaly author page.

8. search.php :- For display the search result page.

9. 404.php :- For display 404 error page.

10. taxonomy.php :- For display the taxonomy archive.

11. attachment.php :- For managing the single attachments page.

12. date.php :- For managing date based archive.

13. header.php :- For managing top part of page.

14. footer.php :- For manage bottom part of pages.

15. What are the template tags in wordpress.

A template tag is code that instructs WordPress to “do” or “get” something.Like in header.php we will use the tag bloginfo(‘name’) to get information from user profile.

The the_title() template tag is used to display the post title.

wp_list_cats() are for display categories.

get_header() for getting header.

get_sidebar() for display the sidebar on page.

get_footer() for get the footer content on page.

16. What are the custom fields in wordpress.

We will add extra information to your post by using custom fields.Custom Fields are a form of meta-data that allows you to store arbitrary information with each WordPress post.

Meta-data is handled with key/value pairs. The key is the name of the meta-data element. The value is the information that will appear in the meta-data list on each individual post that the information is associated with.

To display the Custom Fields for each post, use the the_meta() template tag.

To fetch meta values use the get_post_meta() function.

For example we use custom fields:-

<?php echo get_post_meta($post-&gt;ID, 'key', true); ?>

17. What are meta tags in wordpres.

Meta tags keywords and description are used to display information about website or page.The commanly used meta tags are:-

<meta name="resource-type" content="document" />
<meta http-equiv="content-type" content="text/html; charset=US-ASCII" />
<meta http-equiv="content-language" content="en-us" />
<meta name="author" content="deepak" />
<meta name="contact" content="" />
<meta name="copyright" content="" />
<meta name="description" content="" />
<meta name="keywords" content="" />

18. Can WordPress use cookies.

Yes, wordpress use cookies.WordPress uses cookies, or tiny pieces of information stored on your computer, to verify who you are. There are cookies for logged in users.

19. If you are hacked in wordpress but steps have to do for prevent it.

The various steps have to do when you hacked:-

1. Change passwords for all users, especially Administrators and Editors.

2. Re-install the latest version of WordPress.

3. Make sure all of your plugins and themes are up-to-date.

4. Install security plugins like wp security for safe from hacked.

20. What is the wordpress loop.

The Loop are php code used by WordPress to display posts. Using The Loop, WordPress processes each post to be displayed on the current page.

For example:-

	if ( have_posts() ) {
		while ( have_posts() ) {
			// Post Content here
		} // end while
	} // end if

21.How Using a WordPress Page as Home Page.

1.In admin panel,Goes to pages tab.

2.Select ‘Add New’ from pages tab.

3.Give the title of page as you like for example ‘Site Map’ and add content .

4.Publish the page.

Step1.Goes to admin panel,reading tab under the settings tab of left sidebar wordpress

Admin panel -> Settings -> Reading

Step2.Now set ‘Front page displays’ to ‘A Static Page’ from the your latest posts.

Setting -> Reading -> Front Page Displays -> A Static Page -> Front Page(Drop-down)

Step3.Select your created page from the drop-down like ‘Site Map’ as Front Page.

Leave a Reply

Your email address will not be published. Required fields are marked *