A snippet starter kit for every new agency build
The analytics, hardening and cleanup snippets we drop into every project on day one.
Every agency has a list like this, usually living in someone’s Notes app. Ours is nine snippets that go onto a new build before anything else, plus the workflow for getting them there in one step rather than nine.
Groups matter here. Put all of these in a group called Base and every future you can tell at a glance which snippets are the boilerplate and which are this client’s actual requirements.
The kit
1. Analytics
Content, Site Wide Header, condition Logged-in equal False.
Your GA4 or Plausible tag, not firing for the team. Covered in detail in Add GA4 without another plugin.
2. Staging noindex
Content, Site Wide Header, condition URL includes staging.
<meta name="robots" content="noindex, nofollow" />
One condition, and staging stops competing with production in search results. This is the snippet that has saved us the most embarrassment.
3. Disable comments
Functions, Run Everywhere. Most client sites do not use comments, and an open comment form is a spam surface you will otherwise be moderating in six months.
add_action( 'init', function () {
foreach ( get_post_types() as $type ) {
remove_post_type_support( $type, 'comments' );
}
} );
add_filter( 'comments_open', '__return_false', 20 );
4. Sensible mail headers
Functions, Run Everywhere. wp_mail_from and wp_mail_from_name, set to the client’s domain, so
password resets do not arrive from wordpress@.
5. Hide the admin bar for non-editors
Functions, Run Everywhere.
add_action( 'after_setup_theme', function () {
if ( ! current_user_can( 'edit_posts' ) ) {
show_admin_bar( false );
}
} );
Customers with accounts should not see WordPress chrome.
6. Admin CSS
Styles, Backend. Hide the notices the client does not need to worry about, tighten up whatever the theme’s admin styling gets wrong.
7. Upload limits and mime types
Functions, Admin Only. Whatever this client’s content team keeps trying to upload — .svg,
.webp, oversized PDFs — handled once, at the start, rather than as a support ticket in month two.
8. A branded login
Styles, with the login page targeted. Small, and clients notice it more than anything else on this list.
9. Maintenance notice
Content, Site Wide Body Open, saved as a draft. Written in advance, switched on in one click the next time you need it. A draft snippet is written to disk and validated but never run — a staged-and-ready state that costs nothing.
Moving the kit between sites
Building these by hand nine times is exactly the tedium the kit is meant to remove. Two ways to avoid it:
Export and import. Export the Base group from a finished site and import the file into the new one. The snippet files carry everything — type, run location, priority, conditions — because all of that lives in the file header, not in a table.
Copy the directory. For a site you are cloning anyway, copy
wp-content/fluent-snippet-storage/ across, minus the generated index.php. Load any admin page
once and FluentSnippets notices the files changed and rebuilds the index. This is also what makes
git pull work on a site whose snippets are in version control.
Keep the kit itself in a git repository, one directory of .php files. Improving a snippet means committing once, not editing it on eleven sites.
Two things to set up before you hand over
The Safe Mode URL. Copy it into the client’s password manager entry alongside the admin login. If a snippet ever takes the site down, that URL is the way back in — and it is no use to anyone sitting in a settings screen they cannot reach.
Standalone mode, if the client is not keeping the plugin. Enable it, deactivate FluentSnippets,
confirm the site still behaves, then delete the plugin. The snippets keep running from a must-use
plugin, the code stays visible in wp-content as ordinary files, and the client owns one fewer
dependency. The full story is in
Standalone mode.
What we deliberately leave out
No snippet in the kit changes anything a client might later change themselves through the admin. No hardcoded menu items, no forced page templates, no CSS that fights the theme’s own settings.
The kit is the invisible layer. If a client can see it, it does not belong here — it belongs in the build.