A collection of open-source tools for automating WordPress content management using Claude Code and DevOps principles. Transform your WordPress blog into a frictionless publishing platform directly from your terminal.
This repository contains sanitized, production-ready scripts that demonstrate how to:
- Publish WordPress posts via REST API from the terminal
- Automate content management with Python scripts
- Check and fix broken links programmatically
- Integrate AI-assisted content creation with WordPress
- Implement GitOps workflows for blog management
wordpress-claude-code-tools/
βββ scripts/ # Core automation scripts
β βββ wordpress_publisher.py # Main publishing script
β βββ check_broken_links.py # Broken links scanner
β βββ fix_broken_links.py # Automated link fixer
β βββ update_post.py # Post update utility
βββ examples/ # Example implementations
β βββ publish_article.py # Example article publisher
β βββ config.example.json # Configuration template
βββ workflows/ # GitHub Actions templates
β βββ deploy.yml # Example deployment workflow
βββ docs/ # Documentation
β βββ SETUP.md # Setup instructions
β βββ API_GUIDE.md # WordPress REST API guide
β βββ CLAUDE_CODE.md # Claude Code integration guide
βββ tests/ # Test scripts
βββ test_api_connection.py # API connection tester
- Python 3.8+
- WordPress site with REST API enabled
- WordPress Application Password (for authentication)
- Claude Code (optional, for AI-assisted content)
- Clone the repository:
git clone https://github.com/alanops/wordpress-claude-code-tools.git
cd wordpress-claude-code-tools- Install dependencies:
pip install -r requirements.txt- Configure your WordPress credentials:
cp examples/config.example.json config.json
# Edit config.json with your WordPress detailsfrom scripts.wordpress_publisher import WordPressPublisher
publisher = WordPressPublisher(
site_url="https://yoursite.com",
username="your_username",
app_password="your_app_password"
)
publisher.publish_post(
title="My DevOps Article",
content="<p>Content goes here...</p>",
status="publish"
)python scripts/check_broken_links.py --site https://yoursite.com- Authenticate using Application Passwords
- Create, update, and delete posts
- Manage categories and tags
- Handle featured images
- Support for custom post types
- Scan all published posts for broken links
- Generate detailed reports
- Automatically fix common link issues
- Batch update multiple posts
- Smart link replacement strategies
- Templates for Claude Code integration
- Content generation helpers
- Automated proofreading workflows
- SEO optimization suggestions
Detailed documentation is available in the docs/ directory:
- Setup Guide: Complete setup instructions
- API Guide: WordPress REST API reference
- Claude Code Integration: AI-assisted content workflows
- Examples: Ready-to-use script examples
Integrate with GitHub Actions for automated deployment:
name: Publish Blog Post
on:
push:
paths:
- 'content/*.md'
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Publish to WordPress
run: python scripts/publish_from_markdown.pyExtend the base functionality:
from scripts.wordpress_publisher import WordPressPublisher
class CustomPublisher(WordPressPublisher):
def publish_with_seo(self, title, content, meta_description):
# Add your custom logic here
passWe welcome contributions! Please see our Contributing Guidelines for details.
- Add new automation scripts
- Improve documentation
- Share your workflow examples
- Report bugs or suggest features
- Add test coverage
This project is licensed under the MIT License - see the LICENSE file for details.
- WordPress REST API team for excellent documentation
- Claude Code by Anthropic for AI assistance
- The DevOps community for inspiration
- Never commit credentials: Use environment variables or config files
- Use Application Passwords: More secure than regular passwords
- Enable HTTPS: Always use SSL for API communication
- Validate inputs: Sanitize all user inputs before API calls
- WordPress multisite support
- Scheduled post automation
- Media library management
- Backup and restore utilities
- Performance monitoring tools
- Integration with more AI platforms
- Open an issue for bug reports
- Start a discussion for feature requests
- Check existing issues before creating new ones
If you find these tools helpful, please consider:
- β Starring this repository
- π¦ Sharing on social media
- π Writing about your experience
- π€ Contributing improvements
Built with β€οΈ by AlanOps - Automating the tedious, one script at a time.