Skip to content

alanops/wordpress-claude-code-tools

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

WordPress Claude Code Tools πŸš€

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.

🎯 Overview

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

πŸ“ Repository Structure

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

πŸš€ Quick Start

Prerequisites

  • Python 3.8+
  • WordPress site with REST API enabled
  • WordPress Application Password (for authentication)
  • Claude Code (optional, for AI-assisted content)

Installation

  1. Clone the repository:
git clone https://github.com/alanops/wordpress-claude-code-tools.git
cd wordpress-claude-code-tools
  1. Install dependencies:
pip install -r requirements.txt
  1. Configure your WordPress credentials:
cp examples/config.example.json config.json
# Edit config.json with your WordPress details

Basic Usage

Publishing a Post

from 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"
)

Checking Broken Links

python scripts/check_broken_links.py --site https://yoursite.com

πŸ› οΈ Core Features

WordPress Publisher

  • Authenticate using Application Passwords
  • Create, update, and delete posts
  • Manage categories and tags
  • Handle featured images
  • Support for custom post types

Broken Links Manager

  • Scan all published posts for broken links
  • Generate detailed reports
  • Automatically fix common link issues
  • Batch update multiple posts
  • Smart link replacement strategies

AI Integration Support

  • Templates for Claude Code integration
  • Content generation helpers
  • Automated proofreading workflows
  • SEO optimization suggestions

πŸ“š Documentation

Detailed documentation is available in the docs/ directory:

πŸ”§ Advanced Usage

GitOps Workflow

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.py

Custom Scripts

Extend 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
        pass

🀝 Contributing

We welcome contributions! Please see our Contributing Guidelines for details.

Ways to Contribute

  • Add new automation scripts
  • Improve documentation
  • Share your workflow examples
  • Report bugs or suggest features
  • Add test coverage

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ™ Acknowledgments

  • WordPress REST API team for excellent documentation
  • Claude Code by Anthropic for AI assistance
  • The DevOps community for inspiration

🚨 Security Notes

  • 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

πŸ“ˆ Roadmap

  • WordPress multisite support
  • Scheduled post automation
  • Media library management
  • Backup and restore utilities
  • Performance monitoring tools
  • Integration with more AI platforms

πŸ’¬ Support

  • Open an issue for bug reports
  • Start a discussion for feature requests
  • Check existing issues before creating new ones

🌟 Show Your Support

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.

About

Open-source tools for automating WordPress content management using Claude Code and DevOps principles

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages