Module 2 WordPress
Module 2 WordPress
WORDPRESS
1. History and Evolution
WordPress began in 2003 as a fork of an existing blogging tool called b2/cafelog. Founders Matt
Mullenweg and Mike Little wanted a better, more stable platform for personal publishing.
The Early Years (2003–2005): Focused purely on blogging and simple text
management.
The Plugin & Theme Era (2005–2009): The introduction of the Plugin Directory and
Theme system transformed WordPress from a blog tool into a CMS.
The API & REST Era (2015–Present): The integration of the REST API allowed
WordPress to become a headless CMS, enabling it to power mobile apps and decoupled
frontend frameworks.
The Block Era (2018–Present): The introduction of the Gutenberg Editor shifted the
platform toward a "Full Site Editing" experience, prioritizing visual block-based layouts
over rigid code templates.
Key Takeaway: WordPress evolved from a simple "micro-blogging" tool into a robust Operating
System for the Web.
2. [Link] vs. [Link]
This is the most common point of confusion for beginners. Think of it as the difference between
renting an apartment and owning a house.
Professor's Note: For professional development and business use, we almost exclusively use [Link] (the
self-hosted version). It provides the autonomy required to customize ERP/POS integrations or complex business logic.
Posts
Rule of thumb: if it's timely and you'll publish more like it regularly → Post. If it's evergreen and
stands alone → Page.
9. Creating and Managing Posts
1. Go to Posts → Add New
2. Enter a title — WordPress auto-generates the URL slug from it (editable)
3. Write content in the block editor (Gutenberg)
4. Set Category and Tags in the right-hand panel
5. Set a Featured Image (shown in previews/thumbnails, theme-dependent)
6. Choose Visibility (Public, Private, Password Protected) and Publish date (immediate or
scheduled)
7. Click Publish (or Save Draft to keep working, Preview to check first)
Managing posts: the Posts list lets you bulk-edit, trash, or quick-edit (inline editing of
title/slug/date without opening the full editor).
10. Formatting Text and Adding Media in Posts
WordPress uses the block editor, where every piece of content is a "block":
· Text blocks: Paragraph, Heading (H2–H6), List, Quote, Table — add with the "+" button or
by typing `/` followed by the block name
· Basic formatting: select text to reveal a toolbar for bold, italic, links, inline code,
strikethrough
· Adding media:
· Image block: upload, choose from Media Library, or insert by URL; supports captions, alt
text (important for accessibility/SEO), and alignment
· Gallery block: multiple images in a grid
· Video/Audio blocks: upload files directly or embed
· Embed block: paste a YouTube, Twitter/X, or other supported URL and it auto-embeds
· Layout blocks: Columns, Group, Cover (image with overlay text) for more complex
designs
· Blocks can be dragged to reorder, and each has its own settings panel on the right
when selected
11. Categories and Tags
Both help organize posts, but differently:
· Categories (Posts → Categories)
· Broad, hierarchical (can have subcategories)
· Every post should have at least one (defaults to "Uncategorized" if none chosen)
· Think of it like a table of contents — few, broad buckets (e.g., "Recipes," "Travel," "Tech")
· Tags (Posts → Tags)
· Specific, non-hierarchical, optional
· Think of it like an index — as many as relevant keywords (e.g., "pasta," "italy," "budget-
travel")
· Useful for cross-referencing related content across categories
Both generate their own archive pages (e.g., `/category/travel/` or `/tag/italy/`) where visitors
can browse related posts.
---
Tip: changes to Settings apply site-wide immediately — no "publish" step needed, unlike
posts/pages.
WordPress Advanced Guide (Part 2)
1. WordPress Themes
Introduction to Themes
A theme controls your site's visual design and layout — colors, fonts, page structure — without
changing your content. WordPress separates content (posts/pages, stored in the database) from
presentation (the theme), so you can switch themes without losing content.
Installing and Activating Themes
1. Appearance → Themes → Add New
2. Search the [Link] theme directory, or click Upload Theme to install a .zip file (for
premium/third-party themes)
3. Click Install, then Activate
Customizing Themes with the Customizer
Appearance → Customize opens a live preview editor where you can adjust:
Site identity (logo, title, tagline, favicon)
Colors and background
Menus and widgets
Homepage settings
Additional CSS (for small custom style tweaks without a plugin)
Newer themes ("block themes") use the Site Editor (Appearance → Editor) instead, which allows
full-site editing including headers, footers, and templates using blocks.
Premium Themes and Child Themes
Premium themes: paid themes (from marketplaces like ThemeForest, StudioPress, or
theme shops like Astra/Divi) typically offering more design options, dedicated support, and
page-builder integration.
Child themes: a theme that inherits the styling/functionality of a "parent" theme but lets
you override or add code safely. This is the recommended way to customize a theme with
code — edits made directly to a parent theme get wiped out when that theme
updates, but a child theme's files are untouched.
o A minimal child theme needs just a [Link] (with a header referencing the parent)
and a [Link].
2. Plugins
What Are Plugins?
Plugins are packages of code that add functionality to WordPress without modifying core files —
contact forms, SEO tools, galleries, e-commerce, caching, security, and more. WordPress's plugin
architecture is a major reason for its flexibility.
Installing and Activating Plugins
1. Plugins → Add New
2. Search the directory or Upload Plugin (zip file)
3. Click Install Now, then Activate
4. Many plugins add their own settings page (often under Settings, or their own top-level
menu item)
Popular Plugins by Category
SEO: Yoast SEO, Rank Math
Page building: Elementor, WPBakery, Beaver Builder
Forms: WPForms, Contact Form 7, Gravity Forms
Security: Wordfence, Sucuri
Backup: UpdraftPlus, Duplicator
Caching/performance: WP Rocket, W3 Total Cache, WP Super Cache
E-commerce: WooCommerce
SEO/marketing add-ons: MonsterInsights (Google Analytics), Mailchimp integrations
Customizing Plugins and Understanding Conflicts
Most plugins expose settings pages for basic customization; deeper changes usually
require hooks (actions/filters) added via a child theme's [Link] or a small custom
"site-specific" plugin — never edit a plugin's core files directly, since updates will overwrite
them.
Conflicts happen when two plugins:
o Load the same JavaScript/CSS library in incompatible versions
o Try to control the same functionality (e.g., two SEO plugins, two caching plugins)
o Have incompatible coding (rare, but possible with heavily customized sites)
Plugins like Members or User Role Editor let you create custom roles or fine-tune capabilities.
Adding and Managing Users
Users → Add New: enter username, email, and assign a role. WordPress emails the new user a
password-setup link (or you can set one manually). Users → All Users: edit, change roles, or
delete existing accounts; bulk actions available.
Creating Accounts with Different Permissions
Assign roles based on function: give clients "Editor" (not Administrator) so they can manage
content without touching settings/plugins; give writers "Author" or "Contributor" depending on
whether they should publish directly.
User Profile Settings
Users → Profile (or Your Profile): name, bio, profile picture (via Gravatar), admin color scheme,
keyboard shortcuts for comment moderation, toolbar visibility, and password change.
6. Search Engine Optimization (SEO)
SEO Basics for WordPress
WordPress is fairly SEO-friendly out of the box (clean code, permalink control), but on-page
factors still matter: quality content, proper heading structure (one H1 per page), descriptive
URLs, internal linking, image alt text, and mobile-friendliness.
Using SEO Plugins (e.g., Yoast SEO)
Yoast (and similarly Rank Math) adds a metabox to each post/page for:
Custom SEO title and meta description
Focus keyphrase analysis with readability/SEO scoring
XML sitemap generation
Control over noindex/nofollow per post
Breadcrumbs and schema markup support
Optimizing Content for Search Engines
Use one primary keyword/phrase naturally in the title, first paragraph, and a heading
Write unique meta descriptions per page
Use descriptive, keyword-relevant permalinks (/best-pasta-recipes/ not /post-123/)
Add descriptive alt text to all images
Interlink related posts/pages
Keep content genuinely useful — modern search algorithms weight relevance and quality
heavily
SEO Best Practices for WordPress Sites
Choose a fast, lightweight, well-coded theme
Use HTTPS (SSL certificate)
Optimize images before upload (see Performance section)
Set up Google Search Console and submit your sitemap
Avoid duplicate content (watch for category/tag archives duplicating post content)
Keep site structure shallow (important pages within 2–3 clicks of the homepage)
7. Security and Backup
Importance of Website Security
WordPress's popularity makes it a common target for automated attacks (brute-force logins,
outdated-plugin exploits, malware injection). A breach can mean data loss, blacklisting by search
engines/browsers, or reputational damage.
Securing a WordPress Installation
Keep WordPress core, themes, and plugins updated
Use strong, unique passwords and enable two-factor authentication
Limit login attempts (via plugin) to block brute-force attacks
Change the default admin username; avoid predictable usernames
Keep the number of active plugins minimal — each is a potential attack surface
Use a reputable host with server-level security (firewalls, malware scanning)
Disable file editing from the dashboard (define('DISALLOW_FILE_EDIT', true); in wp-
[Link])
Use SSL/HTTPS site-wide
Backup Solutions
Plugins: UpdraftPlus, Duplicator, BackupBuddy
Store backups off-server (cloud storage: Google Drive, Dropbox, S3) so a compromised
server doesn't take backups down with it
Back up both the database and the files (uploads, themes, plugins)
Schedule automatic backups (daily/weekly depending on how often content changes)
Security Plugins and Techniques
Wordfence: firewall, malware scanning, login security
Sucuri: security monitoring, firewall, malware cleanup
iThemes Security: hardening features (file change detection, brute-force protection)
Combine plugin-level security with server-level measures (host firewalls, regular
core/plugin updates) — no single plugin is a complete solution.
8. E-commerce with WordPress
Introduction to E-commerce Plugins
WooCommerce is the dominant WordPress e-commerce plugin (free, open-source, highly
extensible). Alternatives include Easy Digital Downloads (digital products) and shopping-cart-
focused options for niche needs.
Setting Up an Online Store
1. Install and activate WooCommerce
2. Run the setup wizard: store location/currency, industry, product types
3. Configure shipping zones and tax settings
4. Choose a store-compatible theme (Storefront is WooCommerce's official free theme)
Managing Products and Orders
Products → Add New: title, description, price, images, categories/tags, inventory (stock
tracking), product type (simple, variable — e.g., size/color variants, digital/downloadable)
WooCommerce → Orders: view, process, and update order status (Processing,
Completed, Refunded, etc.); manage customer details and shipping
Payment Gateway Integration
WooCommerce supports built-in gateways (like direct bank transfer/COD) plus extensions for
Stripe, PayPal, Square, and region-specific gateways. Each gateway plugin typically requires
API keys from the payment provider's dashboard, configured under WooCommerce → Settings →
Payments.
9. Performance Optimization
Speeding Up WordPress Sites
Key levers: hosting quality, caching, image optimization, minimizing plugin bloat, and using a
CDN.
Caching Techniques
Page caching: serves a pre-built static HTML version of a page instead of rebuilding it
from PHP/database on every visit (WP Rocket, W3 Total Cache, WP Super Cache, or server-
level caching from your host)
Browser caching: tells visitors' browsers to store static assets (CSS/JS/images) locally for
repeat visits
Object caching: caches database query results (Redis/Memcached), useful for high-traffic
sites
Image Optimization
Compress images before/after upload (plugins: Smush, ShortPixel, Imagify)
Use modern formats (WebP) where supported
Enable lazy loading so images below the fold load only as the user scrolls (built into
WordPress core by default since 5.5)
Serve appropriately sized images rather than relying on CSS to shrink oversized files
Minification and Optimization Plugins
Minification: strips whitespace/comments from CSS/JS files to reduce size
Combining files: reduces the number of HTTP requests (less critical with HTTP/2)
Tools: Autoptimize, WP Rocket (includes minification), Asset CleanUp (disable unused
CSS/JS per page)
10. Multisite and Multilingual Websites
Setting Up WordPress Multisite
Multisite lets one WordPress installation run multiple sites sharing the same core
files/plugins/themes.
1. Add define('WP_ALLOW_MULTISITE', true); to [Link]
2. Go to Tools → Network Setup, choose subdomain or subdirectory structure
3. Follow the prompts to update [Link] and .htaccess
4. After reload, a new My Sites → Network Admin area appears for managing all sites
Managing Multiple Sites from One Installation
The Network Admin dashboard lets a Super Admin create new sites, manage users across the
network, and control which themes/plugins are network-activated (available to all sites) vs. site-
specific.
Creating a Multilingual Website
Plugins: WPML (premium, robust), Polylang (free/premium tiers), TranslatePress
These let you create translated versions of posts/pages, switch based on visitor language,
and add a language switcher widget/menu
Best Practices for Multisite/Multilingual
Plan the site structure (subdomains vs. subdirectories vs. domain mapping) before launch
— hard to change later
Keep plugin count lean — network-wide plugins affect every site's performance
For multilingual: maintain consistent URL structure per language (e.g., /en/, /fr/) for SEO
clarity
Regularly audit that all language versions stay in sync content-wise
11. Advanced Customization
Customizing Themes with Code
Beyond the Customizer, deeper changes involve editing theme template files ([Link],
[Link], [Link], etc.) — always via a child theme to survive updates.
Creating Custom Page Templates
In a theme (or child theme), create a new PHP file with a template header comment:
php
<?php
/* Template Name: Full Width Page */
get_header();
// custom layout code here
get_footer();
This template then becomes selectable from the Page Attributes panel when editing a page.
Using Child Themes for Advanced Customization
Reiterating: child themes are the safe way to override template files, add custom [Link]
code, or load additional stylesheets/scripts — without risking loss of changes on parent theme
updates.
Customizing Plugins and Functionality
For plugin behavior changes, prefer hooks (add_action/add_filter) over editing plugin files
directly. Many well-built plugins expose specific filters for this purpose (documented in their
developer docs).
12. Troubleshooting and Maintenance
Common WordPress Issues and Solutions
White Screen of Death: usually a PHP error or memory limit issue — enable debug mode
to identify it, or deactivate plugins one by one
Locked out of admin: reset password via database (phpMyAdmin) or use an FTP-based
"emergency" password reset script
500 Internal Server Error: often a corrupted .htaccess or plugin conflict — regenerate
permalinks, or deactivate plugins via FTP by renaming the plugins folder
Broken images/styles after migration: usually a URL mismatch — update Site/Home
URL in the database or use a migration plugin
Debugging Techniques
Enable WordPress debug mode in [Link]:
php
define('WP_DEBUG', true);
define('WP_DEBUG_LOG', true);
define('WP_DEBUG_DISPLAY', false);
This logs errors to wp-content/[Link] without displaying them to site visitors. Also check
server error logs, and browser console for JS errors.
Updating WordPress Core, Themes, and Plugins
Always back up before updating (especially major version updates)
Test updates on a staging site first for critical/production sites
WordPress core often updates automatically for minor security releases; major releases
and most plugin/theme updates are manual (or can be automated with caution)
Check plugin/theme changelogs for breaking changes before updating
Best Practices for Ongoing Maintenance
Regular backups (automated, off-site)
Keep core/themes/plugins updated on a schedule
Monitor uptime and security scans
Periodically remove unused plugins/themes (even inactive ones pose some risk and
clutter)
Review user accounts periodically and remove stale/unnecessary access
Keep a staging environment for testing changes before they go live