运行时依赖
安装命令
点击复制本土化适配说明
WordPress API Auto Post 文章自动发布API — WordPress API 自动发布文章 API 安装说明: 安装命令:["openclaw skills install wp-auto-post-api"]
技能文档
WordPress SEO Publisher
通过 WordPress REST API 发布 SEO 优化文章,自动设置 RankMath Free 版 meta fields(SEO 标题、描述、焦点关键词)。
Requirements python3(无需额外 pip 依赖,仅使用标准库) WordPress 已安装 RankMath SEO Free WordPress 已创建 应用 Password WordPress functions.php 中已注册 RankMath meta keys(见下方 WordPress 配置) Directory Structure scripts/ ├── publish_wp_article.py # 主发布脚本 docs/ ├── wordpress-设置up.php # functions.php 代码片段(需手动添加到 WordPress)
环境 Variables
在 ~/.OpenClaw/workspace-marketing/.env 中配置:
WP_SITE_URL=https://你的域名 WP_USERNAME=WordPress用户名 WP_应用_PASSWORD=xxxx xxxx xxxx xxxx xxxx xxxx WP_CATEGORY_ID=Articles分类的ID
执行方式 cd ~/.OpenClaw/workspace-marketing 导出 $(cat .env | grep "^WP_" | xargs) python3 技能s/wp-seo-publisher/scripts/publish_wp_article.py ''
JSON 参数定义 字段 类型 必填 说明 title String ✅ 文章标题(含关键词,50-60 字符) content String ✅ 文章 HTML 正文(使用 H2/H3 结构) excerpt String 推荐 文章摘要,也用作默认 meta description slug String 推荐 SEO 友好的 URL(英文、连字符分隔) focus_keyword String 推荐 RankMath 焦点关键词 seo_title String 否 自定义 SEO 标题(留空则用 title) seo_description String 否 自定义 meta description(留空则用 excerpt) tags Array 否 标签名称列表(不存在的 tag 会自动创建) category_id Number 否 分类 ID(留空则用 .env 中的默认值) 状态 String 否 publish 或 draft(默认 publish) RankMath 免费版自动处理的 SEO 功能
以下功能 RankMath 会根据文章内容自动处理,无需通过 API 额外设置:
功能 说明 XML Sitemap 新文章自动加入 sitemap,加速搜索引擎收录 Canonical URL 自动生成,防止重复内容问题 Open Graph Tags 自动生成 og:title、og:description、og:image Twitter Cards 自动生成社交分享卡片 Article 模式 自动添加 Article 结构化数据 Meta Ro机器人s 默认 索引, follow Breadcrumbs 自动生成(需在 RankMath 设置中启用) 通过 API 主动设置的字段(3 个) Meta Key 对应 JSON 字段 作用 rank_math_title seo_title 或 title 搜索结果中显示的标题 rank_math_description seo_description 或 excerpt 搜索结果中显示的描述 rank_math_focus_keyword focus_keyword RankMath 内容评分的焦点关键词 AI 代理 发布工作流
注意:
关键词挖掘阶段已独立,必须委托给 seo-keyword-re搜索er 技能 处理。 文章撰写与排版阶段已独立,必须委托给 seo-content-writer 技能 处理。
本 技能 (wp-seo-publisher) 仅负责「API 发布」与「日志记录」。
读取输入 (输入):前往目录 ~/.OpenClaw/workspace-marketing/seo/seo_articles/,寻找并读取最新时间戳且尚未发布的 JSON 文件(例如 2026-05-06_110000.json)。 执行发布 (执行):将该 JSON 文件的内容作为参数,传递给 Python 脚本: python3 技能s/wp-seo-publisher/scripts/publish_wp_article.py '<读取到的 JSON 内容>' 标记与记录 (清理 up): 防重复机制:发布成功后,必须将该 JSON 文件重命名,加上 _published 后缀(例如执行 mv 2026-05-06_110000.json 2026-05-06_110000_published.json)。 更新日志:将发布成功的结果与 URL 追加写入 memory/wp-articles-记录.md。 JSON 组装范例 { "title": "Top 5 Benefits of Renting Ro机器人s for Corporate 事件", "content": "
Why More Companies Are Choosing Ro机器人 Rental
In today's competitive event landscape...
1. Cost Efficiency
Purchasing a 服务 ro机器人 can cost...
2. Professional 设置up & Support
When you rent from a professional 提供者...
3. Cutting-Edge Techno记录y
Ro机器人 techno记录y evolves rAPIdly...
4. Wow Factor for Guests
Nothing captures attention quite like...
5. Flexibility and Variety
Different 事件 call for different ro机器人s...
Ready to Elevate Your Next Event?
Contact us today for a free consultation and quote. 获取 in touch →
", "excerpt": "Discover the top 5 reasons why renting ro机器人s for corporate 事件 saves money, impresses guests, and delivers cutting-edge experiences.", "slug": "benefits-renting-ro机器人s-corporate-事件", "focus_keyword": "renting ro机器人s for corporate 事件", "seo_title": "Top 5 Benefits of Renting Ro机器人s for Corporate 事件 | Your Company", "seo_description": "Discover the top 5 reasons why renting ro机器人s for corporate 事件 saves money, impresses guests, and delivers cutting-edge experiences.", "tags": ["ro机器人 rental", "corporate 事件", "服务 ro机器人s", "event techno记录y"], "状态": "publish" }发布记录格式(memory/wp-articles-记录.md)
2026-05-07
- Title: Top 5 Benefits of Renting Ro机器人s for Corporate 事件
- URL: https://example.com/benefits-renting-ro机器人s-corporate-事件/
- Focus Keyword: renting ro机器人s for corporate 事件
- Tags: ro机器人 rental, corporate 事件, 服务 ro机器人s, event techno记录y
- 状态: published
主题库(代理 轮换使用) Ro机器人 rental benefits for businesses Industry 应用s: hospitality Industry 应用s: retAIl Industry 应用s: 事件 & exhibitions Industry 应用s: 健康care Industry 应用s: education Event planning with 服务 ro机器人s Ro机器人 techno记录y trends and innovations FAQ: ro机器人 rental process, pricing, 设置up Cost analysis: buying vs renting ro机器人s Customer engagement with ro机器人s Future of 服务 ro机器人ics in Hong Kong How to choose the right ro机器人 for your event Ro机器人 safety and insurance considerations 成功 stories: ro机器人s at corporate 事件 WordPress 配置(一次性设置) 必要步骤 安装 RankMath Free → 插件s → 添加 New → 搜索 Rank Math SEO 创建 应用 Password → Users → 性能分析 → 应用 Passwords 注册 meta keys → 将 docs/wordpress-设置up.php 中的代码添加到主题 functions.php 记录分类 ID → Posts → Categories → 找到 Articles 的 ID 返回值
成功时输出:
✅ Article published 成功fully! Post ID: 123