🌐 Translation: Translated from Korean.


title: “Local WordPress Testing Complete and Rank Math SEO Integration – @blog/cli Development Journey”
excerpt: “Sharing the local WordPress environment integration test results and Rank Math SEO plugin integration process for the @blog/cli tool”
categories: [“Development”, “WordPress”, “Automation”]
tags: [“WordPress”, “RankMath”, “SEO”, “LocalDevelopment”, “BlogAutomation”, “AdSense”, “LocalByFlywheel”]
status: publish
language: en



Complete Workflow Verification of @blog/cli in Local WordPress Environment!

Over the past few days, I’ve been conducting integration testing of the @blog/cli tool in a local WordPress environment. In this post, I’ll share the entire process, lessons learned, and my experience integrating the Rank Math SEO plugin.

🎯 Project Overview

@blog/cli is a CLI tool that automatically publishes blog posts written in markdown to WordPress. Key features:

  • Automatic markdown → WordPress publishing
  • Automatic SEO meta tag generation
  • Automatic AdSense ad code insertion
  • Multilingual content management (Korean/English)

🔧 Local WordPress Environment Setup

Using Local by Flywheel

To safely test before production deployment, I used Local by Flywheel.

Setup Process:

  1. Install Local by Flywheel
  2. Create new WordPress site (blog-local-test)
  3. Select PHP 8.1.9, WordPress 6.7.1
  4. Generate Application Password
  5. Test REST API connection

Tip: Application Passwords can be generated in WordPress Admin → Users → Profile. A 24-character password is generated, which you can enter into your .env file after removing spaces.

🎨 Avada Theme Configuration

I used the premium theme Avada 7.11.13. Key settings:

  • Blog Layout: Large Alternate
  • Archive Layout: Grid
  • Social Media Sharing: ON

Fusion Builder and Fusion Core plugins are automatically installed, providing powerful page builder functionality.

🚀 Rank Math SEO Plugin Integration

Why Choose Rank Math?

Initially, I generated SEO tags with just WordPress and Avada, but only 70% of tags were created:

Initial State (70% Success):

  • ✅ Title, Meta Description
  • ✅ Open Graph (og:title, og:description, og:url, og:image)
  • ❌ Meta Keywords (missing)
  • ❌ Twitter Card (all tags missing)

Twitter Card tags were completely missing, causing Twitter share previews to not display properly.

Rank Math vs Yoast SEO

Reasons for choosing Rank Math:

  1. More Free Features: Most of Yoast SEO’s premium features are included in Rank Math’s free version
  2. REST API Support: Supports meta field updates through WordPress REST API
  3. Automatic Twitter Card Generation: Automatically generates Twitter Card tags upon installation

Code Integration

I added Rank Math meta fields to packages/core/src/wordpress.ts:

// Rank Math SEO plugin fields
postData.meta = {
  rank_math_title: seoData.meta.title,
  rank_math_description: seoData.meta.description,
  rank_math_focus_keyword: seoData.meta.keywords.join(', '),
  rank_math_robots: [seoData.meta.robots],
};

Result: 90% → 100% Modern SEO

After Rank Math Integration (90% Success):

  • ✅ Title, Meta Description
  • ✅ Open Graph (all tags)
  • ✅ Twitter Card (twitter:card, twitter:title, twitter:description)
  • ⚠️ Meta Keywords (missing)

🤔 Why Are Meta Keywords Missing?

Meta Keywords tags were missing, showing a 90% success rate, but this is normal behavior.

History of Meta Keywords

  • Before 2009: Used by search engines like Google and Bing
  • 2009: Google officially excluded Meta Keywords from ranking decisions (Google Official Blog)
  • Present: Can actually be considered spam

Modern SEO Best Practices

Modern SEO focuses on:

  • Content Quality: High-quality content
  • Semantic HTML: Semantic HTML markup
  • Structured Data: Schema.org structured data
  • Open Graph & Twitter Card: Social media sharing optimization

Modern SEO plugins like Rank Math and Yoast SEO don’t generate Meta Keywords by default. Therefore, 90% success rate = 100% from a modern SEO perspective.

💰 AdSense Ad Auto-Insertion Verification

I also verified the automatic AdSense ad code insertion functionality.

Test Results:



  • Number of ads: 2 found
  • Client ID: Properly configured ✅
  • Slot ID: Properly configured ✅
  • Ad Positions:
    • Ad #1: After first paragraph
    • Ad #2: After second paragraph

The injectAds function in packages/core/src/ads.ts properly inserts AdSense code into HTML.

🧪 Test Results

Automated Testing

  • packages/core: 112 tests passed
  • packages/cli: 55 tests passed
  • Total: 167 tests passed ✅

Scope Adjustment: Pragmatic Approach

The original plan was to automate WordPress integration testing, but complexity increased due to API signature mismatches and missing template files.

Adjustment Decision:

  • SKIP automated integration tests
  • Complete curl-based REST API connection tests
  • Replace with manual testing focused on real-world use cases

Rationale:

  1. REST API connection verified with curl
  2. Existing 167 unit tests provide sufficient coverage
  3. Real-world scenario validation is more important
  4. Low ROI compared to development time

This pragmatic approach allowed me to quickly complete verification and prepare for production deployment.

📝 Lessons Learned

1. SEO Tag Verification Automation

Instead of manually checking browser developer tools, I automated it with Python scripts:

  • verify-seo.py: SEO meta tag verification
  • verify-ads.py: AdSense ad position verification
curl -s "http://blog-local-test.local/post-url/" | python3 verify-seo.py

These scripts can be integrated into CI/CD pipelines for automation.

2. Advantages of Local by Flywheel

  • Simple installation and setup
  • Easy PHP/WordPress version management
  • Automatic SSL setup
  • Built-in database management tools

Highly recommended as a local development environment.

3. Value of Rank Math

Despite being a free plugin, it provides features comparable to Yoast SEO premium. WordPress REST API support also makes integration with external tools easy.

4. Importance of Pragmatic Approach

Rather than delaying development by pursuing perfect automated testing, it’s more valuable to pragmatically verify core functionality and deploy quickly.

🚀 Next Steps

Immediately Actionable

  1. ✅ Local environment verification complete
  2. ✅ Rank Math SEO integration complete
  3. ✅ AdSense advertising feature verification complete

Production Deployment Preparation

  1. Choose WordPress hosting (Bluehost, SiteGround, WP Engine)
  2. Register Avada license
  3. Install Rank Math SEO plugin
  4. Replace with actual AdSense ID
  5. Install SSL certificate (Let’s Encrypt)

Future Improvements (Epic 6.0+)

  1. Enhanced Automation:

    • Batch upload/update
    • Scheduled publishing
    • Automatic image optimization
  2. Revenue Optimization:

    • Ad position A/B testing
    • Performance analytics dashboard
    • AI-based content optimization suggestions
  3. Multilingual Content Management:

    • WPML or Polylang plugin integration
    • Automatic translation feature (DeepL API)

📚 References

🎉 Conclusion

I successfully completed local WordPress environment testing of the @blog/cli tool. With Rank Math SEO plugin integration, I now generate complete SEO tags following modern SEO best practices, and verified the automatic AdSense ad insertion functionality.

With a pragmatic approach, I quickly verified core functionality and am now ready for production deployment. Moving forward, I plan to deploy to an actual hosting environment and continuously improve features.

Detailed Report: Full test results and process can be found at tasks/local-testing-report.md.


Date: 2025-10-28
Project: @blog/cli v0.1.0
GitHub: dh1789/blog