Automating WordPress SEO Optimisation with MCP and Claude Code

A Case Study in AI-Powered Site Management

This case study demonstrates how AI automation via the Model Context Protocol and Claude Code transformed a labour-intensive WordPress SEO optimisation project into a streamlined, chat-based workflow. What would typically require hours of manual WordPress administration was completed in two sessions without accessing the admin interface, addressing 11 critical errors, optimising 52 pages, and implementing strategic internal linking across 40 posts.

Note – I am not an SEO-bro or marketing guru, but have been running my own websites for years.

Where we started!

The Challenge

Following an Ahrefs site audit, niallmcnulty.com required SEO optimisation to address multiple critical issues: 11 broken URLs generating 404 errors, 52 pages lacking meta descriptions, 2 orphan pages disconnected from site navigation, and 40+ posts requiring strategic internal linking for topical authority. Traditional approaches would take hours of manual work through the WordPress admin interface, switching between plugins, copying content, and updating individual posts one at a time.

The scope presented a classic automation opportunity: repetitive tasks that required precision and consistency across dozens of pages, with clear inputs from structured Ahrefs reports and well-defined outputs that conformed to SEO best practices.

The AI Automation Solution

Rather than logging into WordPress repeatedly, this project used the Model Context Protocol (MCP) to enable programmatic WordPress management entirely through a conversational AI interface (Claude Code). The MCP server provided direct access to WordPress REST APIs, allowing systematic execution of all optimisation tasks without manual admin interface interaction.

The technical architecture proved remarkably straightforward. Installing the WordPress MCP server required a single command to configure API credentials and endpoints. Once authenticated, the entire optimisation workflow is executed through natural language instructions, with the AI translating requirements into precise API calls.

For example, creating 301 redirects for broken URLs involved the AI analysing Ahrefs CSV data (report generated by the platform), mapping old URLs to appropriate replacement content, installing and configuring the Redirection plugin via API, and systematically creating eleven properly-formatted redirects with verification. Tasks that previously required navigating multiple WordPress screens, copying URLs between browser tabs, and clicking through plugin interfaces have become a single conversational exchange.

Meta description optimisation demonstrated the efficiency gains particularly well. Rather than opening 52 individual posts in the WordPress editor, scrolling to the Yoast SEO panel, typing descriptions, and clicking update repeatedly, the entire batch was processed through API calls. The AI analysed post content, generated SEO-optimised descriptions that maintained appropriate keyword density and character limits, and updated all meta fields.

The internal linking implementation showcased a more sophisticated type of automation. The system identified eight strategic content clusters across 40 posts, determined appropriate cross-links based on topical relevance, and inserted properly formatted WordPress block content with strategic anchor text. Each post received 3-4 contextually appropriate internal links, building topical authority and improving site navigation.

Chat-Based CMS Management

MCP represents a significant shift in how technical administrators can interact with content management systems. Rather than context-switching between analysis tools, documentation, and administrative interfaces, the entire workflow remained within a single conversational environment.

Key technical capabilities included:

  • Direct API Access: WordPress REST API for posts, categories, and tags; Yoast SEO API for meta field management; Redirection API for redirect creation; WordPress Menu API for navigation updates.
  • Systematic Processing: Converting UTF-16 encoded CSV files, batch processing posts, handling WordPress API response formats, and maintaining data integrity across operations.
  • Error Handling: Troubleshooting plugin database table creation, correcting redirect data formats, managing authentication, and verifying all changes produced expected HTTP status codes.

The workflow eliminated common inefficiencies in website optimisation: no switching between browser tabs, no manual data entry errors, no forgotten pages in large batches, and no inconsistent formatting across updates. Every operation is executed programmatically while maintaining strategic human oversight of what changes to implement and why.

Claude Code hard at work optimising my website

Results and Time Savings

The two-session optimisation delivered measurable improvements across all critical metrics:

  • 11 broken URLs resolved with SEO-preserving 301 redirects
  • 52 pages optimised with meta descriptions (100% coverage)
  • 2 orphan pages integrated into site navigation
  • 40 posts enhanced with strategic internal linking across 8 content clusters
  • 2 traffic-receiving redirects converted to actual content pages

Manual execution through WordPress admin would require an estimated 12-15 hours: navigating interfaces, copying data between systems, updating individual posts, and verifying changes. And the work would have been schleppy. The AI-automated approach completed identical work in approximately 2 hours across two sessions.

More significantly, the cognitive overhead decreased dramatically. Rather than managing multiple browser windows, remembering plugin locations, and maintaining mental state across repetitive tasks, the entire project proceeded as a structured conversation focused on strategic decisions rather than mechanical execution.

Lessons for AI Automation

This case study demonstrates several principles for effective AI automation in technical workflows:

  • Structured Inputs Enable Automation: Ahrefs CSV reports provided machine-readable data suitable for systematic processing. Well-structured inputs are prerequisites for automated workflows.
  • API Access Unlocks Automation: The WordPress REST API made programmatic content management feasible. Systems exposing APIs become automation candidates.
  • Conversational Interfaces Reduce Friction: The MCP’s chat-based approach maintained context across complex multi-step workflows while preserving human strategic oversight.
  • Verification Remains Essential: Every automated change requires verification. Automation increases efficiency but does not eliminate the need for human validation of outputs.

The project establishes a template for similar WordPress optimisation work: structured analysis, systematic implementation via API, chat-based orchestration, and human-led verification. What traditionally required hours of manual interface navigation becomes a guided conversation between strategic intent and automated execution.

Where we ended up

Leave a Reply