AI Alt Text Builder Documentation – RankPilotAI

AI Alt Text Builder Documentation

Generate concise, SEO-friendly image alt text in one click — powered by RankPilotAI.

1. Plugin Overview

AI Alt Text Builder adds a Generate with AI button to the WordPress Media Library (bulk actions & attachment edit screen). When pressed, it calls RankPilotAI, analyses the image and writes an alt-text that scores a perfect 100/100 whenever it stays ≤ 125 characters.

2. Minimum Requirements

Version
WordPress6.0 or later
PHP8.0 or later
RankPilotAI Site TokenGenerate inside the plugin’s Site Key tab

3. Installation

  1. Download the ZIP from your RankPilotAI account.
  2. Upload → Activate via Plugins ▸ Add New ▸ Upload.
  3. After activation you’re redirected to Settings ▸ AI Alt Text Builder.

4. Quick-Start

4.1 Add your Site Key

Open the Site Key tab, paste the token and click Save. A green success notice confirms server-side validation.

4.2 Choose your GPT model & language

On Alt-Text Settings tab select GPT model and default language. GPT-4 Turbo is always available; GPT-4o unlocks on paid plans.

5. How Generation Works

StepWhat happens
UI clickButton dispatches admin-ajax.php request with action aatb_generate_alt.
Server handlerajax() validates nonce & perms, then calls generate_via_rankpilot().
RankPilotAI APIImage URL, current alt, model & language sent to /alt-text; JSON alt_text returned.
Meta updateString saved to _wp_attachment_image_alt and score to _aatb_score.
UI refreshJS inserts alt-text and paints the score badge.

6. Alt-Length Score

The helper function aatb_length_score() evaluates final alt-text:

LengthScore
0 chars0
≤ 125100
≤ 15080
≤ 17560
≤ 20020
> 2000

Scores appear as colour-coded badges in Media Library list view and on the attachment page.

7. Bulk Generation

Select multiple images in Media ▸ Library ▸ List viewBulk Actions → Generate with AI Alt Text Builder. The plugin queues each ID, processes sequentially and displays success / failure counts in an admin notice.

8. Token Usage & Plans

Every successful generation consumes 1 token (GPT-4 Turbo) or 3 tokens (GPT-4o). Remaining tokens and membership tier (Free, Starter, Pro…) are auto-detected from the Site Key and determine which models appear in the dropdown.

9. Settings Reference

TabOptionDescription
Site KeySite TokenUnique identifier linking your site to RankPilotAI.
Alt-Text SettingsGPT Modelgpt-4-turbo (economical) or gpt-4o (premium).
Default LanguageEnglish, German, French, Spanish, Turkish or custom.
Custom PromptOptional — override the default prompt template sent to RankPilotAI.

10. Developer Hooks

HookTypePurpose
aatb_length_score()FunctionPublic helper – reuse for custom scoring.
aatb_generate_altAJAX actionTriggered on each generation request.
aatb_settingsOption arrayStores all plugin settings; extend to persist custom fields.

11. Troubleshooting

SymptomResolution
403: bad_nonce / refreshThe nonce expired. Reload and try again — JS already retries automatically.
“No tokens left”Top-up tokens or upgrade plan; error bubbles from API.
Generation button disabledSave a valid Site Key and ensure user has upload_files capability.

12. Changelog (highlights)

  • 2.1.0 – Multi-language support; GPT-4o option; improved prompt.
  • 2.0.0 – Bulk generation & token dashboard.
  • 1.x – Initial public release.

13. Support

Need help? Just email [email protected] with your site URL and a short description of the issue.

We’re here to help — let us know how we can boost your image SEO with AI!