WordPress Native SEO & GEO Tweaks archived
Snippets for WordPress native SEO without plugins
by Fernando Tellado · github.com/fernandotellado/wordpress-native-seo
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/fernandotellado/wordpress-native-seo/archive/refs/heads/main.zipWordPress native SEO and GEO — no plugins required
A complete collection of code snippets, constants, and server rules to handle SEO and GEO (Generative Engine Optimization) in WordPress without relying on SEO plugins.
Everything here uses native WordPress filters, actions, wp-config.php constants, and .htaccess rules. No third-party dependencies.
Based on the workshop "Do you really need an SEO/GEO plugin for WordPress?" by Fernando Tellado at WordCamp Europe 2026 in Kraków.
Repository files
All-in-one mu-plugin
| File | Description |
|---|---|
ayudawp-seo-geo-tweaks.php |
All 14 PHP optimizations in a single file, active and ready for production. Drop it in wp-content/mu-plugins/ and it works. Comment out any section you don't need. |
Individual PHP snippets
Pick only what you need. Each file is self-contained and can be used as a standalone mu-plugin or added to your child theme's functions.php.
| File | What it does |
|---|---|
auto-meta-description.php |
Generates <meta name="description"> from 4 native WordPress fields: tagline (homepage), excerpt (posts/pages), term description (archives), bio (authors). For the UI version with per-post overrides and JSON-LD schema, see Native SEO Meta Tags |
clean-head.php |
Removes generator version, WLW manifest, RSD, shortlinks, REST API link, comment feeds, and prev/next links from <head> |
disable-emojis.php |
Removes the emoji detection script and styles loaded on every page |
disable-embeds.php |
Removes oEmbed REST route, discovery links, and host JavaScript |
remove-query-strings.php |
Strips ?ver= from CSS and JS URLs for better CDN and proxy caching |
restrict-rest-api.php |
Limits REST API access to authenticated users only — prevents public exposure of usernames and site data |
customize-sitemap.php |
Removes tags and author archives from the native WordPress XML sitemap |
block-ai-training-bots.php |
Adds rules to the virtual robots.txt to block AI training crawlers (GPTBot, ClaudeBot, Google-Extended, CCBot, Bytespider) while keeping search bots allowed |
handle-low-value-archives.php |
Redirects author and date archives to homepage (301), adds noindex to search results and thin taxonomy archives |
small-seo-tweaks.php |
Enables excerpts on pages, disables self-pingbacks, sets a generic login error message |
open-graph-tags.php |
Generates Open Graph (og:title, og:description, og:image, og:url) and Twitter Card tags from standard WordPress fields. For the full version with smart image detection and per-post overrides, see Native SEO Meta Tags |
Configuration reference files
These files contain constants and rules you copy into your existing WordPress configuration files. Everything is commented out — uncomment what you need.
| File | What it is | Where to use it |
|---|---|---|
wp-config-additions.php |
10 constants: revisions, autosave, trash, file editor, SSL, WP-Cron, memory, script compression, debug | Copy contents into your wp-config.php before the line /* That's all, stop editing! */ |
htaccess-additions.txt |
8 rule blocks: force HTTPS, GZIP compression, browser cache, protect wp-config.php, disable directory listing, block xmlrpc.php, block author scanning, security headers | Copy contents into your .htaccess after # END WordPress. Requires Apache with mod_rewrite, mod_deflate, mod_expires, mod_headers. |
Installation
Option 1: All-in-one mu-plugin (recommended)
- Create the folder
wp-content/mu-plugins/if it doesn't exist - Download
ayudawp-seo-geo-tweaks.phpand place it there - Done — mu-plugins load automatically, no activation required
- Open the file and comment out any section you don't need
Option 2: Individual snippets
- Download only the snippet files you need
- Place them in
wp-content/mu-plugins/(each file works independently) - Or copy the code into your child theme's
functions.php
wp-config.php constants
- Open
wp-config-additions.phpand copy the constants you want - Paste them into your
wp-config.phpbefore the line that says/* That's all, stop editing! */ - Uncomment each constant you want to activate
.htaccess rules
- Open
htaccess-additions.txtand copy the rule blocks you want - Paste them into your
.htaccessafter the# END WordPressblock - Uncomment the rules you want to activate
- These require Apache — they won't work on Nginx or on some local development environments
The meta description snippet explained
The auto-meta-description.php snippet deserves special attention. It replaces the core function of most SEO plugins — meta descriptions — with a single WordPress hook:
| Page type | Source field | Where to edit it |
|---|---|---|
| Homepage | Tagline | Settings → General → Tagline |
| Posts and pages | Excerpt (or trimmed content) | Post sidebar → Excerpt |
| Category / Tag archives | Term description | Categories → Edit → Description |
| Author archives | Biographical info | Users → Profile → Biographical Info |
If a field is empty, no meta tag is generated for that page. The only requirement is filling in the fields that WordPress already provides.
What these snippets cover
Performance
- Remove emoji scripts and styles from every page
- Strip query strings from static resources for better caching
- Disable oEmbed scripts and REST routes
- Clean unnecessary tags from
<head> - Limit post revisions, autosave frequency, trash retention (wp-config.php)
- GZIP compression and browser cache rules (.htaccess)
SEO
- Auto meta descriptions from native WordPress fields
- Open Graph and Twitter Card tags from title, excerpt, and featured image
- Customize the native XML sitemap (exclude tags, authors, pages)
- Redirect low-value archives (author, date) to homepage
- Add
noindexto search results and thin taxonomy archives - Clean permalink structure
GEO (Generative Engine Optimization)
- Block AI training bots while keeping search and citation bots allowed
- Configure the virtual
robots.txtfor AI crawler management
Security
- Restrict REST API to authenticated users
- Disable the file editor in admin
- Block
xmlrpc.phpand author scanning (.htaccess) - Generic login error messages
- Security headers (.htaccess)
- Protect
wp-config.phpfrom direct access (.htaccess)
Going further: plugins for the gaps
These snippets cover the code side, but there are things that benefit from a proper plugin with UI, ongoing updates, and deeper integration. All free:
The Native SEO Suite
A small set of focused plugins that together replace the core functionality of a traditional SEO plugin. Each one does one job well, they share the same philosophy, and they're built to coexist with major SEO plugins (Yoast, Rank Math, AIOSEO, SEOPress, The SEO Framework) — auto-detecting them and stepping aside to avoid duplicate tags.
| Plugin | What it does |
|---|---|
| Native SEO Meta Tags | Meta title, meta description, Open Graph, Twitter Card, and JSON-LD schema (Article, BreadcrumbList, Person for E-E-A-T) from native WordPress fields, with per-post overrides in the block editor |
| Native SEO NoIndexer | Selective noindex per post type, taxonomy, individual post, special pages, and feeds — with editor integration, Quick Edit, bulk actions, and automatic sitemap exclusion |
| Native SEO Sitemap Customizer | Visual control over the native WordPress XML sitemap |
Other companions
| Plugin | What it does |
|---|---|
| WPO Tweaks | All performance optimizations in this repo + critical CSS, deferred CSS, preconnect, lazy loading, database cleanup — zero configuration |
| Easy Actions Scheduler Cleaner | Clean up orphan scheduled tasks left by uninstalled plugins |
| SEO Read More Buttons | Control "Read More" button text and style in archives |
GEO (Generative Engine Optimization)
| Plugin | What it does |
|---|---|
| VigIA | JSON-LD structured data, llms.txt generation, Markdown for AI agents, AI crawler analytics and blocking |
| AI Content Signals | Cloudflare's AI content signals standard, physical robots.txt with visual AI bot control |
| AI Share & Summarize | Share buttons for AI platforms (ChatGPT, Claude, Perplexity...) that include your URL as source |
WordPress 7 native AI
| Plugin | What it does |
|---|---|
| AI Experiments | Official WordPress plugin: AI-powered alt text, excerpts, titles, content review with SEO suggestions |
| AI Provider for OpenAI | OpenAI connector for WordPress AI infrastructure |
| AI Provider for Anthropic | Anthropic/Claude connector for WordPress AI infrastructure |
Security
| Plugin | What it does |
|---|---|
| Vigilante | Basic security hardening |
Requirements
- WordPress 5.5 or higher (for native sitemap support)
- PHP 7.4 or higher
- Apache with
mod_rewrite,mod_deflate,mod_expires,mod_headers(for.htaccessrules only)
Further reading
- How to rank in Google AI Overviews
- SEO and AI: everything you need to know
- Google's "Great Decoupling"
- llms.txt and llms-full.txt explained
- Markdown for AI agents
- JSON-LD in WordPress
- Understanding TTFB
- The wp-config.php file: complete guide
License
GPL-2.0-or-later. Use, modify, and share freely.
Author
Fernando Tellado — WordPress specialist since 2005.