Geo Widget creates structured, citable answer blocks (Answer Cards) directly in the WordPress Gutenberg Editor. This optimizes your content specifically for AI-powered search engines like Google AI Overviews, Bing Copilot, or Perplexity.
Each block consists of a question, answer, bullet points, and sources — including copy buttons so readers and AI systems can correctly cite your content.
Who is this plugin for?
- Content creators who want to be cited in AI answers
- SEO teams focusing on Generative Engine Optimization
- Editorial teams needing structured fact blocks in articles
- Developers integrating Answer Cards into external systems via REST API
Features
Gutenberg Block “Answer Card”
- Question Field — Input field with character limit (max. 140 characters) and live counter
- Answer Field — Multi-line text field for the citable answer
- Word Counter with Traffic Light Indicator — Real-time color-coded assessment of answer length:
- Gray: Too short (under 40 words)
- Green: Ideal length (40-80 words)
- Yellow: Getting long (81-120 words)
- Red: Too long (over 120 words)
- Bullet Points (Key Points) — Up to 6 key statements with add/remove buttons
- Source Management — Up to 6 sources with label, URL, publisher, and date
- Anchor ID — Automatically generated from the question, with umlaut support. Manually overridable with reset option
- Server-Side Rendering — Output is fully rendered server-side (no frontend JavaScript required)
Copy Buttons
- Copy Link — Copies the permalink including anchor fragment to clipboard
- Copy Citation — Copies a formatted citation: “Question” — Post Title (Site Name, Date) URL
- Visual Feedback — Button shows “Copied!” and is briefly disabled
- Fallback for Older Browsers — Automatic fallback when Clipboard API is unavailable
- Configurable Display — Controllable via sidebar: link only, citation only, or both
REST API
- Public Endpoint —
GET /wp-json/provimedia-geo-widget/v1/answers returns all Answer Cards as JSON
- Filter by Post — Parameter
post_id to retrieve blocks from a specific post
- Pagination — Parameters
per_page and page with response headers X-WP-Total and X-WP-TotalPages
- Read-only — GET requests only, no write operations
- Disableable — Can be completely disabled in settings
Settings Page
- Enable/Disable REST API — Toggles the public API endpoint on or off
- Include Answer in Citation — Adds the answer text to the citation
- Default Copy Mode — Global default: Link & Citation, Link only, or Citation only
- Strict Word Limit — Enforces the 120-word limit when saving
Security
- Input sanitization of all attributes
- Consistent late-escaping against XSS
- Protocol whitelist for URLs (http/https only)
- No innerHTML or eval in frontend JavaScript
- Drafts and password-protected posts excluded from API
- SQL injection protection via parameterized queries
- Whitelist validation of all setting values
- Nonce protection (CSRF) on settings page
- External links with
rel="noopener noreferrer"
Clean Uninstallation
- On uninstall, all plugin options and transients are completely removed from the database
Compatibility
- WordPress 6.0 or higher
- PHP 7.4 or higher
- Gutenberg Block API v3
- RTL support (automatically generated stylesheets)
- Translation-ready (Text Domain: provimedia-geo-widget)
Development
The compiled JavaScript and CSS files in the /build directory are generated from source files in the /src directory using WordPress build tools.
Source Code
All source code is included in the plugin:
/src/index.js – Editor block component (React/JSX)
/src/frontend.js – Copy button functionality (Vanilla JS)
/src/editor.scss – Editor-only styles (SCSS)
/src/style.scss – Frontend styles (SCSS)
Build Instructions
- Install Node.js (v18 or higher recommended)
- Navigate to the plugin directory
- Run
npm install to install dependencies
- Run
npm run build to compile assets
Build Commands
npm run build – Compile production assets
npm run start – Watch mode for development
npm run lint – Run code linting
npm run test – Run unit tests
Dependencies
- @wordpress/scripts – WordPress build toolchain
- @wordpress/blocks – Block registration API
- @wordpress/block-editor – Block editor components
- @wordpress/components – UI components
- @wordpress/i18n – Internationalization utilities
- @wordpress/element – React abstraction layer
- @wordpress/url – URL validation utilities