WordPress Interview Questions and Answers

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

10.wp_usermeta

11.wp_users

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.

11. 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.

<?php

add_action( ‘wp_head’, ‘webs_expert’ );

function webs_expeert () {

echo “<div>This is test</div>”;

}

?>

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 .= ‘<div>This is test</div>’ . ” “;

}

return $content;

}

?>

12. 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.

13. 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.

14. 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->ID, ‘key’, true); ?>

15. 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="" />

16. 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.

17. 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.

18. 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:-

<?php 
	if ( have_posts() ) {
		while ( have_posts() ) {
			the_post(); 
			//
			// Post Content here
			//
		} // end while
	} // end if
?>

3 comments

  1. i am really in a search of this kind of article. cheers admin !!

Leave a Reply

Scroll To Top