WordPress Tutorial
Learn WordPress development from the loop and template hierarchy to block themes, hooks, plugins, custom post types, the REST API, security and real projects. 68 lessons with examples, quizzes and projects.
Start learning →
of lessons completed
Getting Started
- What Is WordPress? Learn what WordPress is, how a CMS separates content from design, the difference between wordpress.org and wordpress.com, and what you will build in this course.
- Setting Up a Local WordPress Site Set up WordPress on your own computer. Learn the PHP and database requirements, local tools, installing with WP-CLI, wp-config.php, salts and table prefixes.
- Anatomy of a WordPress Install Tour the WordPress file structure. Learn what wp-admin, wp-includes and wp-content hold, how index.php and wp-settings.php start a request, and which files you may edit.
- How WordPress Handles a Request Follow one WordPress request from index.php to the final HTML. Learn the bootstrap order, plugins_loaded, init, parse_request, the main query and template loading.
- Debugging WordPress Learn to debug WordPress. Use WP_DEBUG, WP_DEBUG_LOG, SCRIPT_DEBUG and SAVEQUERIES, read debug.log, fix the white screen of death and isolate a bad plugin safely.
Using the Dashboard
- Managing Posts, Pages, Categories and Tags Use the WordPress dashboard for content: posts versus pages, statuses, scheduling, previews, trash, private and password-protected content, categories, tags and featured images.
- Media Library, Site Settings, Permalinks and Comments Manage uploads and image sizes, set the site icon, configure General, Reading, Discussion and Permalink settings, control comments and recover a lost admin login.
- Page Builders, Landing Pages, Forms and Choosing Plugins Compare the block editor with page builders such as Elementor, build a landing page, pick a contact form and user plugin, and vet any plugin or theme with a checklist.
- Backups, Updates, Maintenance Mode and .htaccess Back up and restore a WordPress site, update core, plugins and themes safely, use maintenance mode, create and understand .htaccess, clear caches and enable a Multisite network.
- Sitemaps, SEO Basics and a Table of Contents Learn how the WordPress XML sitemap works, add an HTML sitemap, set up SEO basics such as titles and canonical URLs, and generate a table of contents from headings.
The Database and the Loop
- The WordPress Database Schema Understand the WordPress database tables: wp_posts, wp_postmeta, terms and taxonomies, users, options and comments, plus post types, statuses and why the meta table matters.
- The Loop Learn the WordPress Loop - have_posts() and the_post(), the global $post, template tags like the_title() and the_content(), setup_postdata() and a no-posts fallback.
- WP_Query in Depth Learn WP_Query - arguments like post_type, posts_per_page, orderby, s, author, date_query and post__in, found_posts, max_num_pages, wp_reset_postdata and no_found_rows.
- Meta Queries and Taxonomy Queries Learn WP_Query meta_query and tax_query - compare operators, types, relation, nested groups, the performance cost of meta queries, and orderby meta_value_num.
- The Main Query and pre_get_posts Understand the WordPress main query - why query_posts() is wrong, how pre_get_posts and is_main_query() change archives safely, conditional tags and pagination.
Classic Themes and the Template Hierarchy
- The Template Hierarchy Learn how WordPress chooses a template file for posts, pages, archives, search and 404 pages - specificity chains, custom templates, template_include and block themes.
- Your First Classic Theme Build a minimal classic WordPress theme - the style.css header, index.php, header.php and footer.php, wp_head and wp_footer, body_class and add_theme_support basics.
- Template Parts and Template Tags Split a classic WordPress theme into reusable template parts with get_template_part, pass data with args, and write your own safe template tags.
- Enqueuing Styles and Scripts Load CSS and JavaScript the WordPress way with wp_enqueue_style and wp_enqueue_script - handles, dependencies, versions, defer, localized data and conditions.
- Menus, Widgets and Sidebars Register navigation menus and widget areas in a classic theme, print them with wp_nav_menu and dynamic_sidebar, customize the markup and learn how block widgets differ.
- Images, Thumbnails and Media Understand how WordPress stores uploads, creates image sizes, adds srcset and lazy loading, and how to register sizes and print featured images in a theme.
- Child Themes Learn what a WordPress child theme is, how the Template header links it to its parent, how files and functions are overridden, and when to skip it.
Hooks: Actions and Filters
- Actions and Filters Learn the hook system behind every WordPress theme and plugin - add_action, do_action, add_filter, apply_filters, callbacks, arguments and return values.
- Priorities, Order and Removing Hooks Learn how WordPress hook priorities and accepted_args work, why remove_action needs the same priority, how to remove class-method hooks, and how to inspect running hooks.
- Creating Your Own Hooks Learn to add extension points to your plugin or theme with do_action and apply_filters - naming, prefixes, context arguments, documentation, deprecation and testing.
- Core Hooks You Will Use A guided tour of the WordPress hooks you will use daily - init, after_setup_theme, wp_enqueue_scripts, admin_menu, save_post, the_content, pre_get_posts and more - in firing order.
Block Themes and the Site Editor
- Block Themes: The Big Picture Understand WordPress block themes - how they differ from classic themes, their folder layout, the minimum files, the Site Editor, global styles and hybrid themes.
- theme.json Learn theme.json for WordPress block themes - version 3, settings for color, typography, spacing and layout, global, element and block styles, presets and CSS variables.
- Block Templates and Template Parts Learn how block theme templates and template parts work - HTML files with block comments, post content, the Query Loop block, custom templates and Site Editor versus files.
- Block Patterns Learn how block patterns work in WordPress block themes, from the patterns directory and PHP headers to categories, synced patterns, overrides and locking.
- Style Variations, Fonts and Design Tokens Learn how block themes ship style variations, section styles, local fonts, fluid typography with clamp() and spacing scales, and how to build a dark variation.
- PHP in Block Themes See when a WordPress block theme still needs PHP: functions.php, register_block_style, wp_enqueue_block_style and the render_block filter, with a stand-in.
Plugins
- Your First Plugin Write your first WordPress plugin: the header comment, the ABSPATH guard, prefixing, hooks, mu-plugins and coding standards, with a runnable loader.
- Plugin Structure and Object-Oriented Plugins Organize a WordPress plugin with a clean folder layout, namespaced classes, an autoloader, dependency injection and bootstrapping on plugins_loaded.
- Activation, Deactivation and Uninstall Handle the WordPress plugin lifecycle: activation hooks, default options, flushing rewrite rules, uninstall.php cleanup and version-based upgrade routines.
- $wpdb and Custom Tables Use the global $wpdb safely: prepare() placeholders, get_results, insert, update, delete, dbDelta for custom tables, and how to avoid SQL injection.
Custom Post Types, Taxonomies and Fields
- Custom Post Types Learn to create WordPress custom post types with register_post_type(): arguments, labels, supports, show_in_rest, archives, rewrite, capabilities and templates.
- Custom Taxonomies Group content with custom taxonomies: register_taxonomy(), hierarchical vs flat, the terms API, taxonomy templates, term meta and default terms explained.
- Custom Fields and Post Meta Store extra data on posts with post meta: add, update and get_post_meta, single vs array values, register_post_meta for REST and sanitizing, protected keys.
- Meta Boxes and Saving Data Build WordPress meta boxes: add_meta_box, rendering fields, nonces, safe save_post checks for autosave and capabilities, sanitizing, and block editor panels.
- Permalinks and Rewrite Rules Understand WordPress permalinks and rewrite rules: structure tags, add_rewrite_rule, add_rewrite_tag, query vars, endpoints, template_redirect and when to flush.
Shortcodes, Options and Admin Pages
- Shortcodes Learn how WordPress shortcodes work: add_shortcode, shortcode_atts, enclosed content, nesting, escaping output, do_shortcode and when to use blocks instead.
- The Options API and Transients Store settings and cached data in WordPress: get_option, update_option, autoload and its cost, serialized values, site options, and transients with expiry.
- The Settings API Build safe plugin settings pages with the WordPress Settings API: register_setting, sections, fields, sanitize callbacks, defaults, error messages and REST.
- Admin Pages, Menus and List Tables Add admin menu pages and submenus, check capabilities, show notices, handle forms with admin-post.php and understand WP_List_Table in a WordPress plugin.
REST API, AJAX and Blocks
- The REST API Read WordPress content as JSON with the REST API: wp-json routes, _fields, _embed, filtering, pagination headers, authentication options and CORS basics.
- Custom REST Endpoints Build custom WordPress REST API endpoints with register_rest_route: methods, args validation and sanitizing, permission_callback, WP_Error, schema and versioning.
- AJAX in WordPress Learn how WordPress AJAX works - admin-ajax.php actions, wp_ajax_ and wp_ajax_nopriv_ hooks, nonces, wp_send_json, localized script data, and when to use the REST API instead.
- Building Blocks: An Overview Learn how WordPress blocks are built - block.json, registerBlockType, edit and save, attributes, create-block, InnerBlocks, block supports and why deprecations exist.
- Dynamic Blocks and Block Bindings Learn dynamic blocks in WordPress - render.php and render_callback, get_block_wrapper_attributes, the Interactivity API overview, the Block Bindings API and when to go dynamic.
Forms, Security and Data Handling
- Forms and Nonces Learn to build a safe WordPress form - admin-post.php, wp_nonce_field, wp_verify_nonce, check_admin_referer, nonce lifetime and ticks, their limits and redirect after post.
- Sanitizing and Validating Input Learn how to handle WordPress input safely - validate vs sanitize, wp_unslash, sanitize_text_field, sanitize_email, absint, wp_kses, wp_kses_post and esc_url_raw, with tests.
- Escaping Output Learn to escape output in WordPress - esc_html, esc_attr, esc_url, esc_js, esc_html__, wp_kses, late escaping, escaping for the right context and how XSS attacks work.
- Users, Roles and Capabilities Learn how WordPress roles map to capabilities, how current_user_can and meta capabilities decide access, and how to add roles safely in a plugin.
- Hardening and Securing a WordPress Site Harden a WordPress site step by step: prepared SQL, nonces, file permissions, updates, wp-config secrets, login limits, 2FA, XML-RPC, backups and plugin risks.
Performance, Tools and Scaling
- Caching and WP-Cron Understand page, object and transient caching in WordPress, how to build safe cache keys and invalidate them, and how WP-Cron schedules work with a real system cron.
- Performance Optimization Find and fix slow WordPress pages: measure with Query Monitor, remove N+1 queries, trim autoloaded options, tune images and scripts, and improve Core Web Vitals.
- WP-CLI Learn WP-CLI: install it, manage core, plugins, themes, posts and options, export databases, run search-replace safely and write your own custom commands.
- Multisite Overview Learn how WordPress Multisite runs many sites from one install: subdomain vs subdirectory, super admins, per-site tables, switch_to_blog and when to use it.
- WooCommerce Basics Learn how WooCommerce stores products and orders, how HPOS changes order storage, how cart and checkout flow, and how to extend a shop safely with hooks.
- Testing, Coding Standards and Deployment Test WordPress code with PHPUnit and wp-env, check style with PHPCS, deploy and move sites safely, keep backups, and translate with __() and _n().
Real-World Projects
- Project: A Block Theme Portfolio Build a portfolio block theme step by step: theme.json design tokens, templates and parts, a project card pattern, and a query loop over a projects post type.
- Project: An Events Plugin Build an events plugin: a custom post type, a date meta box, an upcoming events query, a shortcode, REST output and a clean uninstall, with runnable stand-ins.
- Project: A Secure Contact Form Plugin Build a contact form plugin the safe way: shortcode form, nonce, honeypot, sanitizing, validation, wp_mail, stored submissions and an admin list.
- Project: A Reading List with REST and Blocks Build a reading list plugin: a books post type with meta, a custom REST endpoint, a server-rendered dynamic block, and a settings page for options.
Practice and Review
- WordPress Exercises with Solutions Eight graded WordPress exercises with solutions: hooks, the loop, queries, post types, shortcodes, nonces, sanitizing and capabilities, built as runnable PHP stand-ins.
- WordPress Interview Questions Common WordPress developer interview questions with clear answers: core concepts, hooks, queries, security, performance and block themes, plus runnable PHP demos.
- WordPress Cheat Sheet A compact WordPress cheat sheet: template tags, conditional tags, core hooks, WP_Query arguments, post type and taxonomy options, escaping, WP-CLI and theme.json keys.