What is WordPress?
WordPress is an open-source content management system written in PHP and SQL and uses a MySQL or MariaDB database. It is primarily used for developing websites and blogs.
Almost 40 % of the world's websites are developed using WordPress. It is open source and can be used to create online stores, forums, and social media sites.
It is available in two versions:
- WordPress.org (self-hosted, full control)
- WordPress.com (hosted, limited flexibility)
What are the most important features of WordPress?
The most important features of WordPress are:
- SEO friendly
- Mobile responsive
- Being open-source, there is a vast community that contributes to making themes and plugins
- Interactive and user-friendly interface
- Thousands of free and paid plugins and widgets
- The sites have social media sharing features
- REST API for headless CMS
What are some disadvantages of WordPress?
Some disadvantages of WordPress are as follows:
- Modifying the sites may require some basic knowledge of PHP, HTML, and CSS
- The plugins developed by external developers are not adequately monitored so that they may contain bugs or glitches
- Using more plugins may create many problems of incompatibility
- Altering tables and images within site may be problematic
How to make a WordPress site secure?
Steps to secure a WordPress site are as follows:
- Install the WordPress security plugin to protect the site from malware and viral attacks
- Use a stronger password for the site
- Keep WordPress core, plugins, and themes updated
- Limit login attempts
- Avoid using nulled themes and use premium themes instead
- Use an SSL certificate
- Use two-factor authentication
- Set proper file permissions
What is a slug in WordPress?
A slug is a text that appears right after the domain name of the URL. A post slug is the name of a post that has a valid URL and is user-friendly. It is used for creating permalinks for every post.
For example
- www.xyz.com/slugexample/
What are WordPress hooks?
Hooks are pieces of code through which themes and plugins communicate with each other. WordPress offers many hooks for users, but they can also create their hooks.
Explain the types of hooks in WordPress.
There are 2 different types of hooks, which are as follows:
- Action: This is a hook that is invoked while WordPress is running and allows the user to take a certain action. These functions perform tasks during an event. For example, sending a tweet for a post or creating a widget.
- Filter: This is used for modifying functions. But the modifications are done before the data is sent to the browser or database. For example, adding code below a post
What is Pingback in WordPress?
A Pingback is a type of comment that is used to notify that a blog post is linked to another post from a different site. If the other site is Pingback enabled, the owner will be notified when their post is linked.
For this, the option "Attempt to notify any blogs linked to from the article" has to be checked in the Discussion Settings.
What is an excerpt in WordPress?
An excerpt is a short summary or snippet of a blog post, used to give readers a preview of the content before they click through to read the full article.
Excerpts are commonly used on blog listing pages, archives, and category pages, especially on news and magazine websites, to display multiple articles in a compact and organized format.
In WordPress:
- By default, WordPress automatically generates an excerpt using the first 55 words of a post.
- Alternatively, you can manually add a custom excerpt from the post editor by enabling the "Excerpt" field in the Screen Options (Classic Editor) or using the Excerpt block in Gutenberg.
Excerpts help improve readability and site performance by displaying only partial content on listing pages.
What is the difference between posts and pages in WordPress?
- Posts are articles or blog content that are listed on the sites. They are published in reverse chronological order. The content can be modified from the Posts Menu.
- Pages in WordPress consist of the static content that provides important details about your site like the About page, Contacts page, and privacy policy. These can be edited from the Pages menu.
- Posts are included in RSS feeds; pages are not.
- Posts can be categorized and tagged.
What are plugins in WordPress?
Plugins are software extensions that can be installed to enhance the functionality of your website. There are more than 48,000 plugins in the WordPress plugin directory.
Examples of plugins in WordPress
- WooCommerce – for e-commerce
- Elementor – for page building
- WPForms – for contact forms
What are the plugins used to improve SEO in WordPress?
There are several powerful plugins available in WordPress to help improve a website’s Search Engine Optimization (SEO). These plugins offer features like meta tag management, sitemap generation, keyword optimization, and more.
Here are some of the most popular SEO plugins:
- Yoast SEO – One of the most widely used SEO plugins. It helps optimize content for keywords, manage meta tags, generate XML sitemaps, and more.
- All in One SEO Pack – A comprehensive SEO toolkit that includes features like schema markup, XML sitemaps, and social media integration.
- Google XML Sitemaps – Automatically generates XML sitemaps to help search engines better index your site.
- Rank Math – A lightweight yet powerful SEO plugin that supports rich snippets, redirections, and advanced SEO analysis.
- Broken Link Checker – Scans your website for broken links and missing images, helping you fix SEO-damaging issues.
- W3 Total Cache – Improves site performance, which is a ranking factor for SEO.
- MonsterInsights (Google Analytics plugin) – Helps track visitor behavior and SEO performance using Google Analytics data.
These plugins, when used properly, can significantly improve your site's visibility on search engines, user experience, and overall site health.
What is $wpdb in WordPress?
$wpdb is a WordPress class that is used for communicating with the database through some functions. It primarily connects to the WordPress database but can also be used for interacting with other databases.
By using the $wpdb global variable, the wpdb class can be replaced by the user's settings.
Example:
global $wpdb;
$results = $wpdb->get_results( "SELECT * FROM $wpdb->posts WHERE post_status = 'publish'" );
What is OAuth2 authentication?
OAuth 2.0 (Open Authorization) is an authorization framework that allows third-party applications to access a user's resources without exposing their credentials (like username and password).
Instead of sharing login details, OAuth2 provides the application with an access token that grants limited access to the user's data on platforms like Facebook, Google, or Twitter.
What are the default tables used in WordPress?
Wordpress by default uses 12 tables:
- wp_options
- wp_users
- wp_links
- wp_commentmeta
- wp_term_relationships
- wp_postmeta
- wp_posts
- wp_term_taxonomy
- wp_usermeta
- wp_terms
- wp_comments
- wp_termmeta
How to create a custom theme in WordPress?
To create a custom WordPress theme:
-
Create a theme folder inside
/wp-content/themes/
, e.g.,/my-custom-theme/
. -
Inside the folder, create two essential files:
-
style.css
(contains theme info and basic styles) -
index.php
(main template file)
-
-
Optionally, add other template files like
header.php
,footer.php
,functions.php
, etc. -
In
style.css
, add the theme header:
/*
Theme Name: My Custom Theme
Author: Your Name
Version: 1.0
*/
-
Go to Appearance > Themes in the dashboard and activate your theme.
To enhance the theme:
- Use
functions.php
to enqueue scripts/styles. - Add support for features like menus, widgets, post thumbnails, etc.
How to create a custom plugin in WordPress?
To create a custom plugin:
-
Navigate to
/wp-content/plugins/
and create a folder, e.g.,my-custom-plugin
. -
Inside the folder, create a PHP file, e.g.,
my-custom-plugin.php
.
Add the plugin header:
<?php
/*
Plugin Name: My Custom Plugin
Description: A simple plugin for demonstration.
Version: 1.0
Author: Your Name
*/
- Write your plugin logic using hooks (
add_action
,add_filter
, etc.).
Activate the plugin from the Plugins menu in the WordPress dashboard.
What are the basics of the WordPress REST API?
The WordPress REST API allows developers to interact with WordPress content remotely using HTTP requests and JSON data.
Key Concepts:
- Access via
/wp-json/wp/v2/
endpoint. - Supports CRUD operations (Create, Read, Update, Delete).
- Useful for building headless WordPress, mobile apps, and third-party integrations.
Example:
GET /wp-json/wp/v2/posts
This returns a list of posts in JSON format.
To use the REST API for secure operations (like creating or updating content), you need authentication (e.g., OAuth2 or Application Passwords).
What is the difference between WordPress.com and WordPress.org?
Feature | WordPress.com | WordPress.org |
---|---|---|
Hosting | Hosted by Automattic | Self-hosted |
Custom Themes/Plugins | Limited (only available on paid plans) | Full access |
Cost | Free for basic use, but limited | Free, but you need to buy hosting & domain |
Monetization | Limited, controlled by WordPress.com | Full control (ads, affiliate, eCommerce) |
Suitable for | Beginners, simple blogs | Developers, advanced websites |
What is the difference between Gutenberg and Classic Editor?
Feature | Classic Editor | Gutenberg (Block Editor) |
---|---|---|
Interface | Simple, TinyMCE-based | Modern block-based layout |
Custom Layouts | Limited layout control | Drag-and-drop layout with blocks |
Content Flexibility | Only content area | Each element (text, image, video) is a block |
Extensibility | Fewer plugin options | Highly extensible with custom blocks |
Default Editor Since | Pre-WordPress 5.0 | WordPress 5.0+ |
Gutenberg is the default editor in WordPress now, but Classic Editor can still be used via a plugin.
What is WP-CLI in WordPress?
WP-CLI (WordPress Command Line Interface) is a powerful tool that allows developers to manage WordPress sites via command line, without using the admin dashboard.
Common WP-CLI commands:
wp plugin install plugin-name
– Install a pluginwp theme activate theme-name
– Activate a themewp post create
– Create a postwp user list
– List all users
It’s great for automation, bulk operations, and deploying/migrating sites efficiently.