NewThe WP Tutoring WordPress training platform is live — on demand video courses and interactive WordPress lessons. Free account, no card.Start free
Helping site owners learn WordPress since 2012 · (844) WP-TUTOR
Plugins course · Beginner

Code Snippets: WordPress Plugin Tutorial

Code Snippets tutorial: add custom PHP and site tweaks to WordPress safely, without editing theme files. Each snippet gets its own on/off switch.

3 lessons
10 min
Free with a free account
Start the course free →All 3 lessons free · no card · watch lesson 1 right away

Watch the whole course free on YouTube

FreeAll 3 lessons, with captions and chapters. Open the playlist on YouTube →

  1. Add Custom Code Safely with the Code Snippets Plugin
    From the lesson

    “Plenty of tutorials tell you to open one of your theme's code files and paste something in. The trouble is, that file is fragile: a single typo can knock your whole site down, and the very next theme update quietly wipes out whatever you added. The better way is a snippets plugin, which keeps each piece of code in its own safe, labelled box.” Watch the full lesson →

  2. Create a Snippet: Disable XML-RPC in WordPress
    From the lesson

    “In this lesson you'll meet your very first snippet, learn what every part of it does, and switch it on with confidence. Our example switches off XML-RPC, an old remote-access door most sites never use and a common target for attacks. You'll tour every part of the snippet editor and see exactly how a snippet is put together.” Watch the full lesson →

  3. Deactivate, Clone, and Export Code Snippets Safely
    From the lesson

    “Before we touch the screen, let's see what safe snippet management really means. Turning a snippet off stops it running right away, with nothing left behind. Make a copy before you tinker, so the working original stays safe. Exporting saves a small file you can carry to any other site. Trashing only removes the stored code; the rest of your site is untouched.” Watch the full lesson →

Following along on your own site and stuck on something the video doesn't cover? Book a WordPress tutor — a live session on your own website, $85 an hour.

Code Snippets is a free WordPress plugin that lets you add custom PHP and handy site tweaks without ever editing your theme's files. This short course shows why that's safer, how the snippet library works, and how to add and manage your own tweaks with an on/off switch for each one. You'll come away able to extend WordPress without the fragile copy-into-theme approach.

What you'll learn

Countless tutorials tell you to paste code into a theme file, where one typo can take your site down and the next update quietly erases your work. Learning how to use Code Snippets removes that risk: each tweak lives in its own labelled record that survives theme and WordPress updates and can be switched off in a click. After this course you'll be able to add, organize, and safely manage custom PHP and site tweaks, and undo any change instantly if something misbehaves. It's the sane way to extend WordPress without touching core files.

Inside the course

  • Why Snippets? Touring the Library and Activating Your First One
  • Creating Your First Snippet
  • Managing Snippets Safely: Deactivate, Clone, Export & Good Habits

Who this course is for

This is for confident beginners who don't mind following a tutorial that includes a bit of code, and for anyone who has been warned against editing theme files directly. You don't need to write PHP from scratch. If you're brand new to WordPress, our Fundamentals course is a better place to start.

Frequently asked questions

Is Code Snippets free?
Yes. The plugin is free, and this course is free to watch with a free WP Tutoring account. A pro version exists, but the essentials covered here work in the free plugin.
Do I need to know PHP to use Code Snippets?
Not to get started. Many people paste in snippets they've been given and switch them on. The course shows how to add and manage them safely even if you don't write PHP yourself.
Is Code Snippets safer than editing theme files?
Yes. Snippets stay put when your theme or WordPress updates, each has its own on/off switch, and you can disable a problem one in a click instead of hunting through code.

Get our free WordPress starter guide

Join thousands of site owners and get step-by-step WordPress tutorials in your inbox, plus printable cheat sheets.

Beginner-friendly, no jargon
Printable cheat sheets & checklists
Unsubscribe anytime

Request your session

We’ll reply quickly — usually the same business day.

By using this form you agree with the storage and handling of your data by this site.

Start learning WordPress free — on video, step by step

Two full modules of WordPress Fundamentals, every Quick Fix lesson and the free plugin courses, taught on a real WordPress site. A free account is an email address — no card, no trial clock.

Or browse the full course library first →