Google Indexing
集成 Google 索引 API,以加快内容在 Google 搜索中的收录
FOB Google 索引 API
为 Wpcmf CMS 招聘网站集成 Google 索引 API。
在职位发布、更新或删除时,启用实时索引通知。
主要功能
即时索引:职位发布/更新后数秒内提交至 Google。
全生命周期支持:支持发布、更新、删除及过期事件。
加密凭证:服务账号 JSON 凭据安全存储在数据库中。
配额管理:跟踪每日使用量(每日限额 200 次),并支持自动队列回退。
可扩展性:支持通过 ContentIndexingEvent 自定义内容类型。
系统要求
Wpcmf CMS 7.6+
PHP 8.2+
已启用索引 API 的 Google Cloud 项目
具备索引 API 访问权限的服务账号
安装步骤
将插件复制到目录:platform/plugins/fob-google-indexing/
执行命令:php artisan cms:plugin:activate fob-google-indexing
执行命令:composer update
Google Cloud 环境配置
访问 Google Cloud 控制台。
创建新项目或选择现有项目。
启用索引 API(路径:API 与服务 -> 库)。
创建服务账号(路径:IAM 与管理 -> 服务账号)。
为服务账号创建 JSON 密钥。
将服务账号邮箱添加为 Search Console 的所有者。
配置

操作步骤
- 启用插件
- 粘贴服务账号 JSON 凭据
- 点击保存
- 测试连接
使用方法
自动提交
- 发布时 (URL_UPDATED)
- 更新时 (URL_UPDATED)
- 删除时 (URL_DELETED)
- 过期时 (URL_DELETED)
Artisan 命令行工具
# Check status
php artisan google-indexing:manage --status
# View pending queue
php artisan google-indexing:manage --pending
# Submit specific URL
php artisan google-indexing:manage --url=https://example.com/jobs/123
# Delete URL from index
php artisan google-indexing:manage --delete-url=https://example.com/jobs/123
# Submit all published jobs
php artisan google-indexing:manage --all-jobs
# Clear pending/failed queues
php artisan google-indexing:manage --clear-pending
php artisan google-indexing:manage --clear-failed
