Overview
The Quick Fix endpoint applies automated optimizations to WordPress posts based on issues identified during a GEO audit. It can insert Answer Card blocks, add author information, and apply other content improvements.Endpoint Details
POST
/wp-json/geoai/v1/quick-fixAuthentication
Requires authentication with a user account that hasedit_post capability for the specified post.
See REST API Overview for authentication methods.
Request Parameters
The ID of the WordPress post to apply the fix to. Must be a valid post ID that exists in your WordPress database.
The identifier of the fix to apply. Available fix IDs:
insert_answer_card- Inserts an Answer Card block at the beginning of the postadd_author- Adds author byline information (coming in future update)
Response
Success Response (200)
When the fix is applied successfully:Always
true for successful requests.Confirmation message: “Quick fix applied successfully.”
Error Response (500)
When the fix fails to apply:Always
false for failed requests.Error message describing what went wrong.
Examples
cURL Example
JavaScript (Fetch API)
PHP (WordPress)
Python (Requests)
Response Examples
Successful Answer Card Insertion
Successful Fix (No Additional Data)
Error Responses
Missing Required Parameters
Insufficient Permissions
Invalid Fix ID
Invalid Post ID
Answer Card Already Exists
Post Update Failed
Available Fixes
insert_answer_card
Inserts a GEO AI Answer Card block at the beginning of the post content. What it does:- Checks if an Answer Card block already exists
- Inserts the block markup:
<!-- wp:geoai/answer-card {"tldr":"","keyFacts":[]} /--> - Places it at the very top of the post content
- Returns the updated content
- Returns error if Answer Card already exists in the post
- Returns error if post ID is invalid
- Returns error if post update fails
/home/daytona/workspace/source/includes/class-geoai-rest.php:150
add_author
This fix is planned for a future release. Currently returns an empty success response.
Implementation Details
The Quick Fix endpoint is implemented in/home/daytona/workspace/source/includes/class-geoai-rest.php:109.
Permission Check
The endpoint verifies that the current user hasedit_post capability for the specified post before applying any fixes.
Fix Application Process
- Validates
post_idandfix_idparameters - Checks user permissions
- Routes to the appropriate fix handler based on
fix_id - Applies the fix (may modify post content)
- Returns success confirmation with optional additional data
Content Modification
Fixes that modify post content (likeinsert_answer_card) use wp_update_post() to save changes. This triggers all standard WordPress hooks, so other plugins can respond to the changes.
Best Practices
Run Audit First
Run Audit First
Always run an audit first to identify which fixes are needed. The audit response includes
fix_available flags for each issue.Check for Existing Content
Check for Existing Content
Some fixes (like Answer Card insertion) will fail if the content already exists. Handle these errors gracefully.
Backup Before Batch Operations
Backup Before Batch Operations
If applying fixes to multiple posts programmatically, ensure you have backups. Fixes modify post content directly.
Validate Fix IDs
Validate Fix IDs
Only use fix IDs that are documented as available. Invalid fix IDs return an error.
Monitor for Future Fixes
Monitor for Future Fixes
New fix types may be added in future updates. Check the audit response for available fixes.
Workflow Example
Here’s a complete workflow for auditing and fixing a post:Related Endpoints
Audit
Run a GEO audit to identify issues before applying fixes
API Overview
Learn about authentication and common patterns