WordPress Interview Questions And Answers
WordPress is an open-source content management system where you can add/update/delete content from the admin section. Content may be text, images or videos, etc.
Because it is open source, so you can update the code free of cost. WordPress is built on PHP/MySQL/javascript (which is also an Open Source) and licensed under GPL. You can create different types of websites whether it is personal / or commercial websites. Today most the developers prefer WordPress as it’s easy to install and millions of plugins, and themes are available over the internet free of cost & you can do customization.
1. What is WordPress?
WordPress is Content Management System which have robust admin section. From Admin section you can manage the website text/html, image & videos etc. You can easily manage pages & posts. You can set meta title, meta description & meta keywords for each post. It gives you full control over post & pages .
2. Is WordPress opensource?
Yes, WordPress is opensource and you can do customization as per your requirement. WordPress is built in PHP/MySql/javascript/jQuery which is also an open source.
3. What is the current stable version of WordPress?
The current WordPress stable version is 5.9.2. For details visit https://wordpress.org/
4. What kind of website can I build with WordPress?
WordPress was originally developed as blogging in 2003 but now it has been changed a lot. you can create a personal website as well as a commercial website.
The following types of websites can be built in WordPress:
• Informative Website
• Personal Website
• Photo Gallery
• Business Website
• E-Commerce website
• Blogging
Today, million of free/paid wordpress themes, wordpress plugin are available which help you to create as per your requirement.
5. From where you can download plugins?
https://wordpress.org/plugins/
6. From where you can download themes?
https://wordpress.org/themes/
7. What is Hooks in wordpress?
Hooks allow user to create WordPress theme or plugin with shortcode without changing the original files.
8. What are the types of hooks in WordPress?
Following are two types of hooks
A) Action hooks: This hooks allow you to insert an additional code.
B) Filter hooks: Filter hooks will only allow you to add a content or text at the end of the post.
9. What are positive aspects of wordpress?
• Easy to install and upgrade the wordpress
• In-built SEO engine and you can manage the URL and meta data as per your requirement.
• Easy to themes and plugins
• Multilingual available in more than 70 languages
• Can be do customization as per requirement
• Lots of free/paid themes/plugin available
10. What is the default prefix of wordpress tables?
wp_ is the prefix for wordpress but you can change at the time of installation.
11. What is WordPress loop?
The Loop is PHP code used by WordPress to display posts.
12. What are the template tags in WordPress?
Template tags is a code that instructs WordPress to “do” or “get” something
13. What are meta tags in wordpress?
Meta-tags are keywords and description used to display website.
14. How to secure your wordpress website?
• Install security plug-ins like WP security
• Change password of super admin OR other admin
• Add security level checks at server level like folder/file permission.
15. How many tables a default WordPress will have?
Following are main table in wordpress:
• wp_commentmeta
• wp_comments
• wp_links
• wp_options
• wp_postmeta
• wp_posts
• wp_terms
• wp_term_relationships
• wp_term_taxonomy
• wp_usermeta
• wp_users
16. How to hide the top admin bar at the frontend in WordPress?
Add following code functions.php
1 |
add_filter('show_admin_bar', '__return_false'); |
17. How to hide Directory Browsing in WordPress from the server?
Add the following code in htaccess file
1 |
Options -Indexes |
18. How to display custom fields in WordPress?
1 |
echo get_post_meta($post->ID, 'keyName', true); |
19. How to run database Query in WordPress?
1 |
$wpdb->query("select * from $wpdb->posts where ID>10 "); |
20. What types of hooks in WordPress are used?
1)Following are Actions hooks:.
1 2 3 4 5 6 7 |
has_action() add_action() do_action() do_action_ref_array() did_action() remove_action() remove_all_actions() |
2)Following are Filters hooks.
1 2 3 4 5 6 7 |
has_filter() add_filter() apply_filters() apply_filters_ref_array() current_filter() remove_filter() remove_all_filters() |
21. How can you backup your WordPress content?
WordPress admin -> Tools -> Import
22. List the most common functions used in WordPress?
- wp_nav_menu() :- Displays a navigation menu.
- is_page() :- to check if this is page OR NOT, will return boolean value.
- get_the_excerpt() :- Copy the excerpt of the post into a specified variable.
- in_category() :- Check if the specified post is assigned to any of the specified categories OR not.
- the_title():- Displays the title of the post on a website.
- the_content():- Displays the contents of the post in the website.
23. Template Files List for development WordPress Theme?
Here is the list of the Theme files recognized by WordPress. Of course, your Theme can contain any other stylesheets, images, or files.
style.css: The main stylesheet. This must be included with your Theme, and it must contain the information header for your Theme.
rtl.css: The rtl stylesheet. This will be included automatically if the website’s text direction is right-to-left. This can be generated using the RTLer plugin.
index.php: The main template. If your Theme provides its own templates, index.php must be present.
comments.php:The comments template.
front-page.php: The front page template.
home.php: The home page template, which is the front page by default. If you use a static front page this is the template for the page with the latest posts.
single.php: The single post template. Used when a single post is queried. For this and all other query templates, index.php is used if the query template is not present.
single-{post-type}.php
The single post template is used when a single post from a custom post type is queried. For example, single-book.php would be used for displaying single posts from the custom post type named “book”. index.php is used if the query template for the custom post type is not present.
page.php: The page template. Used when an individual Page is queried.
category.php: The category template. Used when a category is queried.
tag.php:The tag template. Used when a tag is queried.
taxonomy.php: The term template. Used when a term in a custom taxonomy is queried.
author.php: The author template. Used when an author is queried.
date.php: The date/time template. Used when a date or time is queried. Year, month, day, hour, minute, second.
archive.php: The archive template. Used when a category, author, or date is queried. Note that this template will be overridden by category.php, author.php, and date.php for their respective query types.
search.php: The search results template. Used when a search is performed.
attachment.php: Attachment template. Used when viewing a single attachment.
image.php: Image attachment template. Used when viewing a single image attachment. If not present, attachment.php will be used.
404.php: The 404 Not Found template. Used when WordPress cannot find a post or page that matches the query.
24. What is a plugin in WordPress?
Plugins are ways to extend and add to the functionality that already exists in WordPress. The core of WordPress is designed to be lean and lightweight, to maximize flexibility and minimize code bloat. Plugins then offer custom functions and features so that each user can tailor their site to their specific needs.
25. Essential plugins for WordPress?
Here i am going to share some useful plugins that really help you so much for managing and improving the performance as well security of WordPress.
https://wordpress.org/plugins/wordpress-seo/ (Best SEO Plugin)
https://wordpress.org/plugins/google-sitemap-generator/ (sitemap)
https://wordpress.org/plugins/w3-total-cache/ (caching)
https://wordpress.org/plugins/wp-smushit/ (optimizing image files)
https://wordpress.org/plugins/wp-optimize/ (Simple but effective plugin allows you to extensively clean up your WordPress database and optimize it without doing manual queries: )
Security:
Wordfence Security – Firewall, Malware Scan, and Login Security
26. The prefix of WordPress tables by default?
By default, wp_ is the prefix
27. Plugin for Multi-language features?
WPML Multilingual Plugin.
URL: https://wpml.org/
28. Alternative CMS of WordPress?
Joomla
Drupal
Ghost
Movable Type
Silver Stripe
Blogger