# AI features
Source: https://docs.filarank.com/ai
Bring-your-own-key OpenAI, Gemini, Anthropic, Mistral, or DeepSeek for SEO fixes, audit plans, keyword enrichment, and more.
FilaRank is bring-your-own-key. Add a key under **FilaRank SEO → SEO Settings** (stored encrypted via `Crypt`), or fall back to env: `OPENAI_API_KEY`, `GEMINI_API_KEY`, `ANTHROPIC_API_KEY`, `MISTRAL_API_KEY`, `DEEPSEEK_API_KEY`.
Nothing runs unless a key is configured. AI actions hide themselves when `AiService::isConfigured()` is false.
| Feature | Where | What it does |
| - | - | - |
| Fix with AI | SEO section header, per record | Suggests title, meta description, and slug, shown as a before/after diff before anything is written |
| Audit fix plan | SEO Health → Technical audit | Turns an audit issue into a numbered remediation plan |
| Keyword enrichment | Keyword Research | Adds intent, difficulty, and volume estimates to a seed keyword |
| Competitor gaps | Competitors | Suggests keywords a competitor likely targets that you don't |
| Backlink toxicity | Backlinks | Scores a link 0–100 for spamminess |
Every call is logged to `filarank_ai_logs` with provider, model, token counts, and estimated cost, surfaced as a monthly spend figure on the Overview dashboard.
Use **Test AI connection** in Settings to do a real round trip and surface a bad key or unsupported model immediately.
## Choosing a model
The model dropdown in **SEO Settings** is built from config, and that list is the allowlist. Add a model and it becomes selectable, with no code change:
```php theme={null}
'ai' => [
'providers' => [
'openai' => [
'api_key' => env('OPENAI_API_KEY'),
'models' => ['gpt-4o-mini', 'gpt-4o', 'your-new-model'],
'rates' => [
'default' => ['in' => 0.15, 'out' => 0.60],
'gpt-4o' => ['in' => 2.50, 'out' => 10.00],
],
],
],
],
```
The first entry is the default when nothing has been chosen. A saved selection is validated against the list on every read, so removing a model from config quietly falls back to that first entry rather than erroring.
`rates` are USD per 1M tokens and drive the spend estimate. Key a rate by model name to price it exactly; anything without its own entry uses `default`. Getting this wrong only skews the dashboard figure, never a request.
> [!WARNING]
>
> Requests are built per provider, not per model. The OpenAI provider sends `temperature` and a JSON response format, so reasoning-style models that reject a custom temperature will fail with a 400. Because publishing the config replaces the package's `ai` block wholesale, a published copy will not inherit providers added in later versions.
## Using the service in code
```php theme={null}
use Usamamuneerchaudhary\FilaRank\Ai\AiService;
use Usamamuneerchaudhary\FilaRank\Ai\Providers\FakeProvider;
$suggestion = app(AiService::class)->suggestSeoFix([
'title' => $post->seo->title,
'description' => $post->seo->description,
'focus_keyword' => 'coffee beans',
'slug' => $post->slug,
'content' => $post->content,
]);
// Deterministic output for tests (local/testing environments only):
(new AiService)->useProvider(new FakeProvider)->suggestSeoFix([...]);
```
All provider failures are wrapped in `AiRequestException` with credentials stripped out, so a bad key or rate limit never leaks a secret into your logs or a notification. The fake provider is refused outside `local` and `testing`.
# Backlinks
Source: https://docs.filarank.com/backlinks
Import CSV exports from Ahrefs, Semrush, or Search Console, then score toxicity with AI.
You own the data; FilaRank enriches it. Import a CSV export from Ahrefs, Semrush, or Search Console. Headers are matched flexibly (`source_url` / `url` / `referring page`, `dr` / `domain_rating`, and so on), and rows are matched on source + target URL, so re-importing a refreshed export updates rows instead of duplicating them.
Optional [AI toxicity scoring](/ai) runs 25 unscored links at a time and stores a 0–100 spam score.
The importer reports counts:
```php theme={null}
['imported' => int, 'updated' => int, 'skipped' => int]
```
Hide the page if you don't need it:
```php theme={null}
FilaRankPlugin::make()->backlinks(false)
```
# Bulk SEO
Source: https://docs.filarank.com/bulk-seo
Edit titles, descriptions, and robots across records, with a score in the modal and IndexNow submit.
**FilaRank SEO → Bulk SEO** lists every `seo_metas` row. Open a row to edit it in a modal: title, description, focus keyword, robots, noindex, schema type, and a live score. The description field is a short textarea, not a full document editor.
## What you can do
* Filter by model type, score band, and noindex
* Set **noindex** / **index** on the selected rows
* **Submit to IndexNow** for the selected URLs ([same-host only](/indexnow))
* Export / import a CSV of SEO rows
* Optional AI fill when a key is configured
Each save writes a revision in `filarank_seo_revisions`.
## GSC CSV
The bulk page can import a Search Console Pages CSV (impressions, clicks, position). FilaRank does not OAuth into GSC. You download the CSV, then upload it. Rows match on URL.
## Hide the page
```php theme={null}
FilaRankPlugin::make()
->bulkEditor(false)
```
## Related
* [IndexNow](/indexnow)
* [Title templates](/title-templates)
* [Wire SEO fields](/usage)
# Keyword Cannibalization Detection
Source: https://docs.filarank.com/cannibalization
Flag when multiple Filament records target the same focus keyphrase.

On the **SEO Health** page: any keyphrase targeted by more than one record is flagged, sorted most-contested first. Keywords are normalised (case- and slug-insensitive), so "Coffee Beans", "coffee beans" and "coffee-beans" collide. Includes each record's primary **and** related keyphrases.
Combine with [Multiple Focus Keyphrases](/multiple-keywords) when tracking secondary phrases, and [Internal Linking](/internal-linking) to strengthen the page you choose as primary.
# Competitors
Source: https://docs.filarank.com/competitors
Keep a competitor domain list and ask AI which keywords they likely target that you don't.
Competitors is a domain list with an **Analyse gap** action that asks the model which keywords a competitor likely targets that you don't. These are informed estimates from the domain and your own keyword list, not crawled ranking data, so treat them as research prompts, not measurements.
See [AI features](/ai) for how keys and spend logging work.
Hide the page if you don't need it:
```php theme={null}
FilaRankPlugin::make()->competitors(false)
```
# FilaRank Configuration
Source: https://docs.filarank.com/configuration
Site-wide defaults, AI, sitemaps, crawl files, IndexNow, templates, audits, rank tracking, JSON-LD, and score persistence.
Publish the config file to customize FilaRank:
```bash theme={null}
php artisan vendor:publish --tag=filarank-config
```
This creates `config/filarank.php`.
> [!NOTE]
>
> Publishing the config replaces the package's `ai` block wholesale (`mergeConfigFrom` merges only top-level keys). A published copy will not inherit providers or models added in later versions, so re-diff after upgrades. See [Upgrade to v3](/upgrading).
## Site defaults
Used as fallbacks by the `` component when a model has no SEO meta of its own.
```php theme={null}
'site' => [
'name' => env('APP_NAME', 'Laravel'),
'title_separator' => ' — ',
'description' => null,
'og_image' => null,
'twitter_handle' => null, // e.g. '@yourbrand'
'search_url' => null, // e.g. https://example.com/search?q={search_term_string}
],
```
## Tag rendering
Toggle which tags `` renders, and choose which JSON-LD nodes are emitted (also toggleable from **SEO Settings**):
```php theme={null}
'render' => [
'title_tag' => true,
'canonical' => true,
'open_graph' => true,
'twitter_cards' => true,
'json_ld' => true,
'schema_types' => [
'organization' => true,
'website' => true,
'breadcrumb' => true,
'article' => true,
'faq' => true,
'product' => false,
'webpage' => false,
'local_business' => false,
'person' => false,
'event' => false,
'howto' => false,
'video' => false,
],
],
```
See [Structured data](/structured-data) for FAQ and Product schema contracts.
## Analysis
Disable individual checks by id, and set `site_host` so internal/outbound link detection can classify absolute URLs pointing at your own domain (defaults to `APP_URL`'s host).
```php theme={null}
'analysis' => [
'disabled_checks' => ['outbound-links', 'passive-voice'],
'site_host' => null,
],
```
## Persistence
When `true`, the overall score is recalculated and stored on the `seo_metas` row every time the parent model is saved, so it can be shown in table columns without re-analysing.
```php theme={null}
'persist_score' => true,
```
## Multilingual readability
Off by default. Analysis uses the English pack and the content-language selector is hidden. Set `FILARANK_MULTILINGUAL=true` to pick EN/NL/FR/DE/ES per record. See [Readability language packs](/language-packs).
```php theme={null}
'multilingual' => env('FILARANK_MULTILINGUAL', false),
```
## Scanned models
List the models FilaRank should scan for the sitemap, audit, cannibalization, and link graph. Each must use the `HasSeo` trait.
```php theme={null}
'scanned_models' => [
\App\Models\Post::class => ['label' => 'title', 'changefreq' => 'weekly', 'priority' => 0.8],
\App\Models\Page::class => ['label' => 'name'],
],
```
Leave it empty and FilaRank falls back to any model that already has SEO meta rows, so the dashboards aren't blank on a fresh install.
## Redirects
```php theme={null}
'redirects' => [
'enabled' => true,
'auto_register_middleware' => env('FILARANK_AUTO_REDIRECTS', true),
'ignore_paths' => ['/telescope*', '/horizon*', '/_debugbar*', '/livewire*'],
'auto_on_slug_change' => true,
'only_when_published' => true,
],
```
See [Redirect Manager](/redirect-manager) for auto-301s on slug change.
## Cornerstone
Minimum incoming internal links before a cornerstone stops being flagged as under-linked.
```php theme={null}
'cornerstone' => [
'min_incoming_links' => 3,
],
```
## Sitemap
```php theme={null}
'sitemap' => [
'enabled' => true,
'path' => 'sitemap.xml',
'legacy_path' => 'filarank-sitemap.xml',
'index' => true,
'images' => true,
'html' => true,
'changefreq' => 'weekly',
'priority' => 0.5,
'cache_seconds' => 3600,
'ping' => false,
'ping_endpoints' => [
'https://www.bing.com/ping?sitemap={sitemap}',
],
],
```
See [XML sitemap](/sitemap). Crawl files and IndexNow:
```php theme={null}
'files' => [
'robots' => ['enabled' => true],
'llms' => ['enabled' => true, 'limit' => 100],
],
'indexnow' => [
'enabled' => env('FILARANK_INDEXNOW', true),
'endpoint' => 'https://api.indexnow.org/indexnow',
],
'templates' => [
'title' => '{{title}} {{sep}} {{site}}',
],
```
See [robots.txt and llms.txt](/crawl-files), [IndexNow](/indexnow), and [Title templates](/title-templates).
## Technical audit
The crawler only fetches URLs on your own `app.url` host. Extra hosts must be allow-listed **and** must resolve to public addresses.
```php theme={null}
'audit' => [
'allowed_hosts' => ['docs.example.com'],
'max_pages' => 500,
'delay_ms' => 0,
// Since v3.1 the technical audit and the SEO Health score refresh run
// as queued jobs instead of inside the panel request. `job_timeout`
// must stay shorter than your queue connection's `retry_after`.
'queue' => env('FILARANK_AUDIT_QUEUE', true),
'queue_name' => env('FILARANK_AUDIT_QUEUE_NAME', 'default'),
'job_timeout' => 1800,
'unique_for' => 3600,
// Nightly scheduled audit via `php artisan filarank:audit` (off by default).
'schedule' => env('FILARANK_AUDIT_SCHEDULE', false),
'schedule_at' => env('FILARANK_AUDIT_SCHEDULE_AT', '02:00'),
],
```
See [Technical audit](/technical-audit).
## AI
Model lists are the allowlist: add a model name and it becomes selectable in **SEO Settings**. The first entry is the default. `rates` are USD per 1M tokens and drive the spend estimate on the Overview dashboard.
```php theme={null}
'ai' => [
'default_provider' => env('FILARANK_AI_PROVIDER', 'openai'),
'providers' => [
'openai' => [
'api_key' => env('OPENAI_API_KEY'),
'models' => ['gpt-4o-mini', 'gpt-4o', 'your-new-model'],
'rates' => [
'default' => ['in' => 0.15, 'out' => 0.60],
'gpt-4o' => ['in' => 2.50, 'out' => 10.00],
],
],
],
],
```
See [AI features](/ai).
## Rank tracker
```php theme={null}
'rank_tracker' => [
'provider' => env('FILARANK_RANK_PROVIDER', 'serpapi'),
'serpapi_key' => env('SERPAPI_API_KEY'),
'schedule' => true,
'schedule_at' => '03:00',
'allow_scrape' => env('FILARANK_ALLOW_SCRAPE', false),
],
```
Scraping Google is off by default. See [Rank tracking](/rank-tracking).
> [!TIP]
>
> Runtime AI keys, sitemap, schema, and rank-provider options are also editable from **FilaRank SEO → SEO Settings** without republishing config.
# Cornerstone Content in FilaRank
Source: https://docs.filarank.com/cornerstone-content
Mark pillar pages and enforce depth + incoming link thresholds.
A **Cornerstone content** toggle in the SEO section marks your most important pages. Cornerstone records are held to a higher bar by the `cornerstone-depth` analysis check (≥900 words, properly subheaded) and flagged on the dashboard when too few internal links point to them (`config('filarank.cornerstone.min_incoming_links')`).
Use [Internal Linking](/internal-linking) reports to find under-linked cornerstones and add links from cluster content.
# robots.txt and llms.txt
Source: https://docs.filarank.com/crawl-files
Edit /robots.txt in the panel, generate /llms.txt for AI crawlers, and keep a Sitemap line in sync.
FilaRank serves crawl files from Laravel routes, not from files in `public/`. Edit them under **FilaRank SEO → SEO Files**.
> [!WARNING]
>
> If `public/robots.txt` exists, the web server serves that file and the panel editor has no effect. Delete the static file so `/robots.txt` is the virtual one.
## robots.txt
The route is on by default:
```php theme={null}
'files' => [
'robots' => [
'enabled' => true,
],
],
```
The editor ships presets:
* **Allow all**: `Allow: /` plus a `Sitemap:` line pointing at `/sitemap.xml`
* **Block AI crawlers**: common GPTBot / ClaudeBot / Google-Extended rules
* **Strict**: lock down paths you do not want indexed
* **Custom**: free-form text, with revision history
Saving a document that contains `Disallow: /` asks for confirmation so you cannot deindex the site by accident. Revisions are stored in `filarank_robots_revisions`.
Site-wide snippet limits live in config and merge into the robots meta tag, not into `robots.txt`:
```php theme={null}
'robots' => [
'defaults' => [
'max-snippet' => null,
'max-image-preview' => null,
'max-video-preview' => null,
],
],
```
## llms.txt
`/llms.txt` and `/llms-full.txt` are generated from [scanned models](/configuration#scanned-models). Unpublished and `noindex` records are skipped. `/llms-full.txt` appends each page's meta description.
```php theme={null}
'files' => [
'llms' => [
'enabled' => true,
'limit' => 100,
],
],
```
Add a custom block in **SEO Files** if you want a human-written preamble above the generated page list.
Each model still needs `getSeoUrl()` so the file emits real paths. See [Wire SEO fields](/usage).
## Related
* [XML sitemap](/sitemap): the `Sitemap:` line in robots.txt
* [IndexNow](/indexnow): notify Bing when URLs change
* [Upgrade to v3](/upgrading)
# Custom SEO Checks in FilaRank
Source: https://docs.filarank.com/custom-checks
Register your own PHP Check classes alongside built-in Filament SEO analysis rules.
Implement the `Check` contract and register it:
```php theme={null}
use Usamamuneerchaudhary\FilaRank\Analysis\Contracts\Check;
use Usamamuneerchaudhary\FilaRank\Analysis\{CheckResult, ContentContext, Status};
final class NoClickbaitTitle implements Check
{
public function id(): string { return 'no-clickbait'; }
public function group(): string { return 'seo'; }
public function isApplicable(ContentContext $context): bool
{
return filled($context->title);
}
public function run(ContentContext $context): CheckResult
{
$clickbait = str_contains(mb_strtolower($context->title), 'you won\'t believe');
return new CheckResult(
$this->id(),
$this->group(),
$clickbait ? Status::Bad : Status::Good,
$clickbait ? 'Avoid clickbait phrasing in titles.' : 'Title looks trustworthy.',
);
}
}
```
Then run the analyzer with your check added:
```php theme={null}
$report = SeoAnalyzer::analyzer()
->withCheck(new NoClickbaitTitle())
->analyze($context);
```
> [!NOTE]
>
> Groups are `seo`, `readability`, and `geo`. Anything else is ignored by the score panels. The analysis engine (`src/Analysis` and `src/Support`) has zero Laravel dependencies, so custom checks are trivially unit-testable and reusable outside Filament.
## Disabling built-in checks
If you'd rather turn a check off instead of writing your own, disable it by id in `config/filarank.php`:
```php theme={null}
'analysis' => [
'disabled_checks' => ['outbound-links', 'passive-voice'],
],
```
See [Configuration](/configuration) for the full list of analysis options, and [GEO / AEO scoring](/geo-aeo) for the built-in `geo` check ids.
# GEO / AEO scoring
Source: https://docs.filarank.com/geo-aeo
Six checks for AI answer engines: direct answers, FAQs, entities, citations, snippet-length meta, and structured data.
v2 adds a third score group alongside SEO and readability, aimed at generative and answer engines. Results show as **GEO / AEO** in the live analysis panel and contribute to `$report->geoScore()`.
| Check id | What it looks for |
| - | - |
| `direct-answer-block` | An early, substantial passage that names the focus keyword so an answer engine can quote it. |
| `faq-structure` | Question-and-answer blocks in the body. |
| `entity-clarity` | Named entities that make the topic unambiguous. |
| `citation-signals` | Outbound references on longer pages. |
| `snippet-length-meta` | A meta description in the length range answer snippets prefer. |
| `structured-data-ready` | Content that can back JSON-LD (headings, FAQs, and so on). |
Disable any of them by id:
```php theme={null}
'analysis' => [
'disabled_checks' => ['citation-signals'],
],
```
Programmatic access:
```php theme={null}
$report = SeoAnalyzer::analyzeModel($post);
$report->geoScore();
$report->geo(); // GEO check results only
```
Pair this with [Structured data](/structured-data) so the tags you render match what the checks expect, and with [AI features](/ai) to rewrite title, meta, and slug when the snippet-length check fails.
# FilaRank - Filament SEO Toolkit
Source: https://docs.filarank.com/index
Live SEO scoring, GEO/AEO analysis, AI fixes, sitemap indexes, robots.txt, IndexNow, and head tags for Filament admin panels.
FilaRank is an SEO toolkit for [Filament](https://filamentphp.com) v5: live content scoring, readability and GEO/AEO analysis, SERP preview, head-tag rendering, sitemap indexes, robots.txt / llms.txt, IndexNow, redirect management, AI fix suggestions, keyword research, rank tracking, and site-wide health reports. See [Installation](/quickstart) to get started.
> [card] [Installation](/quickstart)
>
> Install FilaRank and run the interactive installer.
> [card] [Upgrade to v3](/upgrading)
>
> Publish v3 migrations and pick up robots.txt, IndexNow, and bulk SEO.
> [card] [Usage](/usage)
>
> Wire up your models, forms, tables, and frontend tags.
> [card] [AI features](/ai)
>
> Bring-your-own-key title, meta, and slug suggestions.
## Features
* **26 analysis checks** across three score groups:
* **SEO** (13): title length, keyword in title / meta description / slug / first paragraph / subheadings, keyword density with stuffing detection, content length, cornerstone depth, internal links, outbound links, image alt text.
* **Readability** (7): Flesch Reading Ease, sentence length distribution, paragraph length, passive voice, transition words, subheading distribution, repeated consecutive sentence openings.
* **GEO / AEO** (6): direct-answer blocks, FAQ structure, entity clarity, citation signals, snippet-length meta, structured-data readiness. See [GEO / AEO scoring](/geo-aeo).
* **Live analysis in the form**: results re-render as the editor types (debounced), with traffic-light indicators and an overall 0–100 score.
* **AI Fix**: one-click title / meta / slug suggestions with a before/after diff. Bring your own OpenAI, Gemini, Anthropic, Mistral, or DeepSeek key. See [AI features](/ai).
* **Google SERP snippet preview** plus Facebook and X social previews, right where the editor needs it. See [Title templates and social](/title-templates).
* **`SeoScoreColumn`**: a sortable red/amber/green badge for any Filament table.
* **Persisted scores**: recalculated whenever the parent model is saved, so table badges never need a live re-analysis.
* **``**: one component that renders `
`, meta description, robots, canonical, Open Graph, Twitter Cards, hreflang, and multi-type JSON-LD (`@graph`) with site-wide fallbacks. Pair with ``.
* **XML sitemap index** at `/sitemap.xml` (per-model changefreq, image sitemap, HTML sitemap). `/filarank-sitemap.xml` 301s to the new path. See [XML sitemap](/sitemap).
* **Crawl files**: panel editor for [`robots.txt` / `llms.txt`](/crawl-files) and [IndexNow](/indexnow).
* **Admin dashboards**: SEO Overview, SEO Health, Keyword Research, Rank Tracker, Backlinks, Competitors, Redirects, SEO Files, Instant Indexing, [Bulk SEO](/bulk-seo), Setup wizard, and Settings. Every page is individually toggleable.
* **Framework-free analysis engine**: `src/Analysis` and `src/Support` have zero Laravel dependencies, so the engine is trivially unit-testable and reusable outside Filament.
* **Interactive installer**: `php artisan filarank:install` publishes assets, migrates, and wires the trait, form section, and score column into the models and resources you pick, with a `--dry-run` mode.
* Fully translatable, publishable views, configurable checks.
> [!TIP]
>
> **v3.1** moves the technical audit to a queued job (with `php artisan filarank:audit` and an optional nightly schedule), adds hreflang audit checks, and gives the JSON-LD Organization/WebSite nodes stable `@id`s. No migrations or breaking changes. See [Upgrading to 3.1](/upgrading#upgrading-to-31). **v3.0** added crawl files, sitemap indexes, title templates, social overrides, bulk SEO, IndexNow, and FR/DE/ES readability packs.
## Requirements
* PHP 8.3+
* Laravel 11 / 12 / 13
* Filament v5
# IndexNow
Source: https://docs.filarank.com/indexnow
Notify Bing and other IndexNow engines when a scanned URL is saved or deleted. Same-host only, no GSC OAuth.
IndexNow is FilaRank's replacement for Google's retired sitemap ping. It is **bring-your-own-notification**: FilaRank posts changed URLs to `https://api.indexnow.org/indexnow`. There is no Google Search Console or GA4 OAuth.
> [!TIP]
>
> Submissions already run automatically when you save or delete a scanned model, and when a SEO row's title or robots change. **FilaRank SEO → Instant Indexing** is for the key file, the on/off switch, and extra URLs by hand.
## Enable it
```php theme={null}
'indexnow' => [
'enabled' => env('FILARANK_INDEXNOW', true),
'endpoint' => 'https://api.indexnow.org/indexnow',
],
```
Set `FILARANK_INDEXNOW=false` on a public demo or CI so saves never leave the machine.
The key file is served at `/{key}.txt` on the same origin. Bing requires that. FilaRank generates a 32-character key on first use and stores it in `filarank_settings`.
## Same-host only
Only URLs on the application host are submitted. A scanned model that returns an absolute URL on another domain is skipped. That stops a misconfigured `getSeoUrl()` from notifying IndexNow about someone else's site.
## Bulk submit
Select rows on **Bulk SEO** and run **Submit to IndexNow**. The same same-host filter applies.
## Config vs Settings
The Instant Indexing toggle writes `indexnow_enabled` into settings. That value wins over `config('filarank.indexnow.enabled')` once it has been saved. Turn it off in the panel if you enabled it in config and later want it quiet.
## Related
* [Bulk SEO](/bulk-seo)
* [robots.txt and llms.txt](/crawl-files)
* [XML sitemap](/sitemap)
# Internal Linking & Orphan Reports
Source: https://docs.filarank.com/internal-linking
Find orphaned content and under-linked cornerstone pages in your Filament SEO dashboard.

List the models you want scanned in `config/filarank.php`. The same list drives the [sitemap](/sitemap), [technical audit](/technical-audit), and cannibalization reports:
```php theme={null}
'scanned_models' => [
\App\Models\Post::class => ['label' => 'title'],
\App\Models\Page::class => ['label' => 'name'],
],
```
The SEO Health dashboard then reports **orphaned content** (pages nothing links to) and **under-linked cornerstones**. The link graph compares URLs by normalised path, so absolute and relative links to the same page match. Programmatic access:
```php theme={null}
$graph = app(\Usamamuneerchaudhary\FilaRank\Reports\SeoReports::class)->linkGraph();
$graph->orphans();
$graph->suggestionsFor($record); // keyphrase-based, cornerstone-boosted
$graph->underlinkedCornerstones(3);
```
See also [Cornerstone Content](/cornerstone-content) for pillar-page flagging and [Keyword Cannibalization](/cannibalization) for competing keyphrase warnings.
# Keyword research
Source: https://docs.filarank.com/keyword-research
Pull Google Autocomplete suggestions, enrich with AI, and promote seeds to tracked keywords.
Research pulls Google Autocomplete suggestions plus modifier expansions for a seed keyword, saves them as untracked rows, and lets you promote the ones you care about to tracked keywords. The table supports search, sorting, filtering by tracked state, and bulk track/dismiss.
Optional [AI enrichment](/ai) adds intent, difficulty, and volume estimates.
```php theme={null}
use Usamamuneerchaudhary\FilaRank\Keywords\KeywordStore;
$store = app(KeywordStore::class);
$store->saveResearched(['coffee beans', 'best coffee beans']);
$store->track('coffee beans'); // never clears existing enrichment
$store->dismiss([$id]); // untracked rows only; tracked keywords are safe
```
Research rows accumulate, so prune them when you're done:
```bash theme={null}
php artisan filarank:prune-keywords --days=30 # dry run, lists what would go
php artisan filarank:prune-keywords --days=30 --force # actually delete
```
Tracked keywords are never pruned, and they hold your [rank history](/rank-tracking).
# Readability Language Packs
Source: https://docs.filarank.com/language-packs
English, Dutch, French, German, and Spanish readability heuristics; register custom language packs.
Readability heuristics (transition words, passive-voice detection, syllable counting, reading-ease formula) sit behind a `LanguagePack` interface. English, Dutch, French, German, and Spanish ship in the box.
The **Content language** selector is hidden unless you opt in:
```php theme={null}
'multilingual' => env('FILARANK_MULTILINGUAL', false),
```
When it is off, analysis always uses the English pack. When it is on, the per-record locale picks EN/NL/FR/DE/ES. Add your own:
```php theme={null}
use Usamamuneerchaudhary\FilaRank\Language\LanguageRegistry;
app(LanguageRegistry::class)->register(new FrenchPack());
```
Extend `AbstractLanguagePack` and implement `transitionWords()`, `countSyllables()`, and the passive-voice word lists. See `EnglishPack` and `DutchPack` for the pattern.
# Multiple Focus Keyphrases
Source: https://docs.filarank.com/multiple-keywords
Target secondary SEO phrases per record with per-phrase analysis in Filament forms.

A **Related keyphrases** tags field lets each record target secondary phrases. The primary keyword gets the full analysis; each related keyphrase gets the keyword-specific SEO checks (title / meta / slug / first paragraph / density / subheadings), shown in the analysis panel. Duplicates of the primary are de-duplicated automatically.
```php theme={null}
use Usamamuneerchaudhary\FilaRank\Keyphrase\KeyphraseAnalyzer;
$results = (new KeyphraseAnalyzer())->analyze($context); // primary first, then related
```
# Install FilaRank on Filament
Source: https://docs.filarank.com/quickstart
Install the Filament SEO plugin with composer and the interactive filarank:install command. Includes dry-run mode.
## Prerequisites
Before you begin, you must have:
* PHP 8.3+
* Laravel 11, 12, or 13
* Filament v5
## Install the package
**1. Require the package**
```bash theme={null}
composer require usamamuneerchaudhary/filarank
```
**2. Run the interactive installer**
```bash theme={null}
php artisan filarank:install
```
The interactive installer publishes the config and migrations, offers to run `migrate`, then shows a checklist of your `app/Models` classes. For each model you pick it will:
1. add the `HasSeo` trait (plus import) to the model,
2. find the matching Filament resource anywhere under `app/Filament` and, with your confirmation, append `SeoFields::make()` to the form and `SeoScoreColumn::make()` to the table, with imports.
Patching is deliberately conservative: files are only modified when the expected structure is found, every edit is idempotent (safe to re-run), and anything that can't be patched automatically falls back to printed manual instructions.
**3. Register the panel plugin**
The admin pages live behind a plugin so you only get the ones you want:
```php theme={null}
use Usamamuneerchaudhary\FilaRank\FilaRankPlugin;
public function panel(Panel $panel): Panel
{
return $panel->plugin(FilaRankPlugin::make());
}
```
Every page defaults to on and can be switched off individually:
```php theme={null}
FilaRankPlugin::make()
->overview() // SEO Overview dashboard
->healthDashboard() // 404s, cannibalization, orphans, technical audit
->keywordResearch()
->rankTracker()
->backlinks(false) // hide the pages you don't need
->competitors(false)
->settings()
->redirects()
->files() // robots.txt + llms.txt
->indexing() // IndexNow
->bulkEditor()
->setupWizard()
```
> [!TIP]
>
> Use `--dry-run` to preview the changes without writing anything to disk:
>
> ```bash theme={null}
> php artisan filarank:install --dry-run
> ```
## Manual installation
Prefer to wire things up by hand? The manual steps below are exactly what the installer automates:
```bash theme={null}
php artisan vendor:publish --tag=filarank-migrations
php artisan migrate
```
Optionally publish the config, views, or translations:
```bash theme={null}
php artisan vendor:publish --tag=filarank-config
php artisan vendor:publish --tag=filarank-views
php artisan vendor:publish --tag=filarank-translations
```
Once installed, continue to [Wire SEO Fields in Filament](/usage) to prepare your model, add the SEO form section, show the score column, and render tags on your frontend.
> [!TIP]
>
> Need to tune site-wide defaults or disable checks? See [FilaRank Configuration](/configuration) after wiring up your resources.
# Rank tracking
Source: https://docs.filarank.com/rank-tracking
Daily SerpAPI position checks for tracked keywords, scheduled automatically at 03:00.
Tracked keywords from [Keyword research](/keyword-research) get daily position checks. SerpAPI is the supported provider: add the key in **SEO Settings** (or `SERPAPI_API_KEY`).
```bash theme={null}
php artisan filarank:check-ranks
```
The command is scheduled automatically (`rank_tracker.schedule_at`, default 03:00) and exits cleanly with a warning when no key is configured, so an unconfigured install doesn't fail every night.
The **Rank Tracker** resource shows position, previous position, and trend.
```php theme={null}
'rank_tracker' => [
'provider' => env('FILARANK_RANK_PROVIDER', 'serpapi'),
'serpapi_key' => env('SERPAPI_API_KEY'),
'schedule' => true,
'schedule_at' => '03:00',
'allow_scrape' => env('FILARANK_ALLOW_SCRAPE', false),
],
```
> [!WARNING]
>
> Scraping Google breaks their terms of service and stops working without warning, so it's disabled unless you opt in with `FILARANK_ALLOW_SCRAPE=true`. Until then the option is hidden from Settings.
# FilaRank
Source: https://docs.filarank.com/readme
SEO toolkit for Filament v5: live scoring, GEO/AEO, AI fixes, sitemap indexes, robots.txt, IndexNow, and head tags. Single-file overview for the Filament plugin directory.

# FilaRank, Filament's SEO Toolkit
SEO toolkit for [Filament](https://filamentphp.com) v5: live content scoring, readability and GEO/AEO analysis, SERP preview, head-tag rendering, sitemap indexes, robots.txt / llms.txt, IndexNow, redirect management, AI fix suggestions, keyword research, rank tracking, and site-wide health reports.
* Live demo: [filarank.com](https://filarank.com)
* Full docs: [docs.filarank.com](https://docs.filarank.com)
* Checkout: [Anystack](https://checkout.anystack.sh/filarank-pro/a22ff325-a480-49c5-bd18-8e9c01990f79)
## Features
* **26 analysis checks** across three score groups:
* **SEO** (13), title length, keyword in title / meta description / slug / first paragraph / subheadings, keyword density with stuffing detection, content length, cornerstone depth, internal links, outbound links, image alt text.
* **Readability** (7), Flesch Reading Ease, sentence length distribution, paragraph length, passive voice, transition words, subheading distribution, repeated consecutive sentence openings.
* **GEO / AEO** (6), direct-answer blocks, FAQ structure, entity clarity, citation signals, snippet-length meta, structured-data readiness.
* **Live analysis in the form**, results re-render as the editor types (debounced), with traffic-light indicators and an overall 0–100 score.
* **AI Fix**, one-click title / meta / slug suggestions with a before/after diff. Bring your own OpenAI, Gemini, Anthropic, Mistral, or DeepSeek key.
* **Google SERP snippet preview** plus Facebook and X social previews, right where the editor needs it.
* **`SeoScoreColumn`**, a sortable red/amber/green badge for any Filament table.
* **Persisted scores**, recalculated whenever the parent model is saved, so table badges never need a live re-analysis.
* **``**, one component that renders ``, meta description, robots, canonical, Open Graph, Twitter Cards, hreflang, and multi-type JSON-LD (`@graph`) with site-wide fallbacks.
* **``**, a visible trail that matches BreadcrumbList JSON-LD.
* **XML sitemap index** at `/sitemap.xml` (per-model changefreq/priority, image sitemap, HTML sitemap). `/filarank-sitemap.xml` 301s to the new path.
* **Crawl files**, a panel editor for `robots.txt` (with revisions and AI-bot presets), `llms.txt` / `llms-full.txt`, and IndexNow (key file + submit on save).
* **Admin dashboards**, SEO Overview, SEO Health, Keyword Research, Rank Tracker, Backlinks, Competitors, Redirects, SEO Files, Instant Indexing, Bulk SEO, Setup wizard, and Settings. Every page is individually toggleable.
* **Framework-free analysis engine**, `src/Analysis` and `src/Support` have zero Laravel dependencies, so the engine is trivially unit-testable and reusable outside Filament.
* **Interactive installer**, `php artisan filarank:install` publishes assets, migrates, and wires the trait, form section, and score column into the models and resources you pick, with a `--dry-run` mode.
* Fully translatable, publishable views, configurable checks.
New in v3.0: crawl files, sitemap indexes, title templates, social overrides, an extensible schema registry, bulk SEO, IndexNow, and FR/DE/ES readability packs. See [Upgrade to v3](https://docs.filarank.com/upgrading) if you already have FilaRank installed.
## Requirements
* PHP 8.3+
* Laravel 11 / 12 / 13
* Filament v5
Optional: [`laravel/head`](https://laravel.com/docs/head) (Laravel 13.17+) if you would rather render tags through Laravel's first-party `@head` directive. See [Using Laravel Head](#using-laravel-head).
## Installation
```bash theme={null}
composer require usamamuneerchaudhary/filarank
php artisan filarank:install
```
The interactive installer publishes the config and migrations, offers to run `migrate`, then shows a checklist of your `app/Models` classes. For each model you pick it will:
1. add the `HasSeo` trait (plus import) to the model,
2. find the matching Filament resource anywhere under `app/Filament`, and, with your confirmation, append `SeoFields::make()` to the form and `SeoScoreColumn::make()` to the table, with imports.
Patching is deliberately conservative: files are only modified when the expected structure is found, every edit is idempotent (safe to re-run), and anything that can't be patched automatically falls back to printed manual instructions. Use `--dry-run` to preview without writing:
```bash theme={null}
php artisan filarank:install --dry-run
```
Prefer to wire things up by hand? The manual steps below are exactly what the installer automates:
```bash theme={null}
php artisan vendor:publish --tag=filarank-migrations
php artisan migrate
```
Optionally publish the config, views, or translations:
```bash theme={null}
php artisan vendor:publish --tag=filarank-config
php artisan vendor:publish --tag=filarank-views
php artisan vendor:publish --tag=filarank-translations
```
### Register the panel plugin
The admin pages live behind a plugin so you only get the ones you want:
```php theme={null}
use Usamamuneerchaudhary\FilaRank\FilaRankPlugin;
public function panel(Panel $panel): Panel
{
return $panel->plugin(FilaRankPlugin::make());
}
```
Every page defaults to on and can be switched off individually:
```php theme={null}
FilaRankPlugin::make()
->overview() // SEO Overview dashboard
->healthDashboard() // 404s, cannibalization, orphans, technical audit
->keywordResearch()
->rankTracker()
->backlinks(false) // hide the pages you don't need
->competitors(false)
->settings()
->redirects()
->files() // robots.txt + llms.txt
->indexing() // IndexNow
->bulkEditor()
->setupWizard()
```
## Usage
### 1. Prepare your model
```php theme={null}
use Usamamuneerchaudhary\FilaRank\Concerns\HasSeo;
class Post extends Model
{
use HasSeo;
}
```
By default the analyzer reads the model's `content` and `slug` attributes and falls back to `title` for the page title. Override if your columns differ:
```php theme={null}
public function getSeoContent(): ?string
{
return $this->body;
}
public function getSeoSlug(): ?string
{
return $this->permalink;
}
/** Public URL, used by the sitemap, link graph, and technical audit. */
public function getSeoUrl(): ?string
{
return route('posts.show', $this, absolute: false);
}
```
### 2. Add the SEO section to your Filament form
```php theme={null}
use Usamamuneerchaudhary\FilaRank\Forms\SeoFields;
public static function form(Schema $schema): Schema
{
return $schema->components([
TextInput::make('title'),
TextInput::make('slug'),
RichEditor::make('content'),
SeoFields::make(), // assumes `content` + `slug` fields on this form
]);
}
```
If your body field has a different name, or lives somewhere unusual in the schema tree:
```php theme={null}
SeoFields::make(contentField: 'body', slugField: 'permalink');
// or take full control of where values are read from and written to:
SeoFields::make(
getContentUsing: fn (Get $get) => $get('../body'),
getSlugUsing: fn (Get $get) => $get('../permalink'),
setSlugUsing: fn (string $value, Set $set) => $set('../permalink', $value),
);
```
> `SeoFields::make()` binds to the `seo` relationship, so it must be used on a form with a record model that uses `HasSeo`.
### 3. Show the score in your table
```php theme={null}
use Usamamuneerchaudhary\FilaRank\Tables\SeoScoreColumn;
public static function table(Table $table): Table
{
return $table->columns([
TextColumn::make('title'),
SeoScoreColumn::make(),
]);
}
```
Scores are recalculated and stored whenever the model is saved (disable with `'persist_score' => false`).
### 4. Render the tags on your frontend
In your layout's ``:
```blade theme={null}
```
Or for static pages without a model:
```blade theme={null}
```
#### Using Laravel Head
Laravel 13.17 shipped [`laravel/head`](https://laravel.com/docs/head), a first-party way to manage the document ``. FilaRank works with it, so you don't have to choose between the panel you're editing SEO in and the head management the rest of your app uses.
It stays optional. FilaRank supports Laravel 11 and 12, `laravel/head` requires 13.17+, so it is a `suggest` rather than a `require`. Nothing changes if you don't install it.
```bash theme={null}
composer require laravel/head
```
Then push the record's stored meta before the view renders, instead of placing the component:
```php theme={null}
use Usamamuneerchaudhary\FilaRank\SeoHead;
public function show(Post $post): View
{
SeoHead::for($post);
return view('posts.show', ['post' => $post]);
}
```
Static pages take the same overrides as the component:
```php theme={null}
SeoHead::for(null, title: 'Contact us', description: 'Get in touch with our team.');
```
Keep Laravel Head's `@head` directive in your layout and drop ``. **Render one or the other, never both**, or every page gets two titles and two JSON-LD blocks.
Both renderers read the same resolution chain (explicit argument, then the stored SEO row, then your model's fallbacks, then site config) and emit the same title, description, canonical, robots, Open Graph, Twitter card, and JSON-LD graph. Two deliberate differences:
* Laravel Head normalizes canonical URLs, forcing `https` and giving a root path its trailing slash. The component emits whatever you stored, verbatim.
* FilaRank's JSON-LD is scrubbed recursively before handover, because Laravel Head rejects null and empty-string values at any depth. This mostly matters if your model's `getProductSchema()` returns partially-filled nested nodes.
`SeoHead::for()` throws if `laravel/head` isn't installed. Guard with `SeoHead::isAvailable()` if you ship code that has to run either way.
### 5. Analyze anything programmatically
```php theme={null}
use Usamamuneerchaudhary\FilaRank\SeoAnalyzer;
$report = SeoAnalyzer::analyze([
'title' => 'Coffee Beans Guide',
'description' => '…',
'focus_keyword' => 'coffee beans',
'slug' => 'coffee-beans',
'content' => $html,
]);
$report->score(); // 0–100 or null
$report->seoScore();
$report->readabilityScore();
$report->geoScore();
$report->rating(); // Status::Good | Ok | Bad
$report->results; // list of CheckResult
```
Or against a model directly: `SeoAnalyzer::analyzeModel($post)`.
## AI features
FilaRank is bring-your-own-key. Add a key under **FilaRank SEO → SEO Settings** (stored encrypted via `Crypt`), or fall back to env: `OPENAI_API_KEY`, `GEMINI_API_KEY`, `ANTHROPIC_API_KEY`.
| Feature | Where | What it does |
| - | - | - |
| Fix with AI | SEO section header, per record | Suggests title, meta description, and slug, shown as a before/after diff before anything is written |
| Audit fix plan | SEO Health → Technical audit | Turns an audit issue into a numbered remediation plan |
| Keyword enrichment | Keyword Research | Adds intent, difficulty, and volume estimates to a seed keyword |
| Competitor gaps | Competitors | Suggests keywords a competitor likely targets that you don't |
| Backlink toxicity | Backlinks | Scores a link 0–100 for spamminess |
Every call is logged to `filarank_ai_logs` with provider, model, token counts, and estimated cost, surfaced as a monthly spend figure on the Overview dashboard. Nothing runs unless a key is configured, AI actions hide themselves when `AiService::isConfigured()` is false.
### Choosing a model
The model dropdown in SEO Settings is built from config, and that list is the allowlist, add a model and it becomes selectable, with no code change and nothing hardcoded on the package side:
```php theme={null}
'ai' => [
'providers' => [
'openai' => [
'api_key' => env('OPENAI_API_KEY'),
'models' => ['gpt-4o-mini', 'gpt-4o', 'your-new-model'],
'rates' => [
'default' => ['in' => 0.15, 'out' => 0.60],
'gpt-4o' => ['in' => 2.50, 'out' => 10.00],
],
],
],
],
```
The first entry is the default when nothing has been chosen, so put your preferred model first. A saved selection is validated against the list on every read, so removing a model from config quietly falls back to that first entry rather than erroring.
`rates` are USD per 1M tokens and drive the spend estimate. Key a rate by model name to price it exactly; anything without its own entry uses `default`. Getting this wrong only skews the dashboard figure, never a request.
Two caveats when adding a model. Requests are built per provider, not per model, the OpenAI provider sends `temperature` and a JSON response format, so reasoning-style models that reject a custom temperature will fail with a 400. And because publishing the config replaces the package's `ai` block wholesale (`mergeConfigFrom` merges only top-level keys), a published copy won't inherit providers added in later versions. Either way, **Test AI connection** in Settings does a real round trip and surfaces the problem immediately.
To use a provider directly, or in tests:
```php theme={null}
use Usamamuneerchaudhary\FilaRank\Ai\AiService;
use Usamamuneerchaudhary\FilaRank\Ai\Providers\FakeProvider;
$suggestion = app(AiService::class)->suggestSeoFix([
'title' => $post->seo->title,
'description' => $post->seo->description,
'focus_keyword' => 'coffee beans',
'slug' => $post->slug,
'content' => $post->content,
]);
// Deterministic output for tests (local/testing environments only):
(new AiService)->useProvider(new FakeProvider)->suggestSeoFix([...]);
```
All provider failures are wrapped in `AiRequestException` with credentials stripped out, so a bad key or rate limit never leaks a secret into your logs or a notification.
## Sitemap
Enable the sitemap in **SEO Settings**; while it's off, the route returns 404 rather than an empty document. Entries are built from your scanned models, skipping records flagged `noindex` or without a public URL.
```php theme={null}
'sitemap' => [
'enabled' => true,
'path' => 'sitemap.xml',
'legacy_path' => 'filarank-sitemap.xml',
'index' => true,
'images' => true,
'html' => true,
'changefreq' => 'weekly',
'priority' => 0.5,
'cache_seconds' => 3600,
'ping' => false,
'ping_endpoints' => [
'https://www.bing.com/ping?sitemap={sitemap}',
],
],
```
With pinging enabled, endpoints are called after a record is saved. Requests are deferred until after the response, so a slow or dead endpoint never delays a content save. The sitemap placeholder in each ping URL is replaced with the URL-encoded sitemap URL. Google retired its ping endpoint in 2023, so the list is deliberately easy to repoint.
## Technical audit
**SEO Health → Technical audit** crawls the public URL of every record with SEO meta and reports missing titles, meta descriptions, canonicals, OG images, and focus keywords, plus broken status codes, absent JSON-LD, and images without alt text.
The crawler only fetches URLs on your own `app.url` host. Extra hosts must be allow-listed *and* must resolve to public addresses, which stops a careless `getSeoUrl()` from pointing the crawler at internal services or cloud metadata endpoints. Blocked URLs are recorded as an `unsafe_url` issue so the meta checks still run and you can see why the fetch was skipped.
```php theme={null}
'audit' => [
'allowed_hosts' => ['docs.example.com'],
'max_pages' => 500,
'delay_ms' => 0, // throttle between requests
],
```
Runs are bounded by `max_pages` and atomic: issues are collected in memory and swapped in one transaction, so a crawl that dies halfway leaves your existing issue list intact.
## Keyword research & rank tracking
Research pulls Google Autocomplete suggestions plus modifier expansions for a seed keyword, saves them as untracked rows, and lets you promote the ones you care about to tracked keywords. The table supports search, sorting, filtering by tracked state, and bulk track/dismiss.
```php theme={null}
use Usamamuneerchaudhary\FilaRank\Keywords\KeywordStore;
$store = app(KeywordStore::class);
$store->saveResearched(['coffee beans', 'best coffee beans']);
$store->track('coffee beans'); // never clears existing enrichment
$store->dismiss([$id]); // untracked rows only; tracked keywords are safe
```
Tracked keywords get daily position checks. SerpAPI is the supported provider, add the key in SEO Settings:
```bash theme={null}
php artisan filarank:check-ranks
```
The command is scheduled automatically (`rank_tracker.schedule_at`, default 03:00) and exits cleanly with a warning when no key is configured, so an unconfigured install doesn't fail every night. Scraping Google breaks their terms of service and stops working without warning, so it's disabled unless you opt in with `FILARANK_ALLOW_SCRAPE=true`; until then the option is hidden from Settings.
Research rows accumulate, so prune them when you're done:
```bash theme={null}
php artisan filarank:prune-keywords --days=30 # dry run, lists what would go
php artisan filarank:prune-keywords --days=30 --force # actually delete
```
Tracked keywords are never pruned, they hold your rank history.
## Backlinks & competitors
Both are deliberately simple: you own the data, FilaRank enriches it.
**Backlinks** imports a CSV export from Ahrefs, Semrush, or Search Console. Headers are matched flexibly (`source_url`/`url`/`referring page`, `dr`/`domain_rating`, and so on), and rows are matched on source + target URL, so re-importing a refreshed export updates rows instead of duplicating them. Optional AI toxicity scoring runs 25 unscored links at a time.
**Competitors** is a domain list with an "Analyse gap" action that asks the model which keywords a competitor likely targets that you don't. These are informed estimates from the domain and your own keyword list, not crawled ranking data, treat them as research prompts, not measurements.
## Configuration
See `config/filarank.php` for site-wide defaults (site name, title separator, default description / share image, Twitter handle), tag-rendering toggles, schema types, disabled checks, and score persistence.
Disable individual checks:
```php theme={null}
'analysis' => [
'disabled_checks' => ['outbound-links', 'passive-voice'],
],
```
Choose which JSON-LD nodes are emitted (also toggleable from SEO Settings):
```php theme={null}
'render' => [
'schema_types' => [
'organization' => true,
'website' => true,
'breadcrumb' => true,
'article' => true,
'faq' => true,
'product' => false,
],
],
```
List the models FilaRank should scan for the sitemap, audit, cannibalization, and link graph:
```php theme={null}
'scanned_models' => [
\App\Models\Post::class => ['label' => 'title'],
\App\Models\Page::class => ['label' => 'name'],
],
```
Leave it empty and FilaRank falls back to any model that already has SEO meta rows, so the dashboards aren't blank on a fresh install.
## Security notes
* **API keys** are encrypted at rest and shown masked in the UI. Paste a new value to replace one; leave the field blank to keep it.
* **Provider errors** pass through `Support\Redactor` before being logged or displayed, stripping query-string credentials, bearer tokens, and known key formats.
* **The audit crawler** is host-restricted (see [Technical audit](#technical-audit)) and refuses redirects to untrusted hosts mid-request.
* **The fake AI provider** is refused outside `local` and `testing`, so a misconfigured production panel can't silently serve canned copy.
* **Google scraping** is off by default and must be enabled explicitly in config.
## Writing your own check
Implement the `Check` contract and register it:
```php theme={null}
use Usamamuneerchaudhary\FilaRank\Analysis\Contracts\Check;
use Usamamuneerchaudhary\FilaRank\Analysis\{CheckResult, ContentContext, Status};
final class NoClickbaitTitle implements Check
{
public function id(): string { return 'no-clickbait'; }
public function group(): string { return 'seo'; }
public function isApplicable(ContentContext $context): bool
{
return filled($context->title);
}
public function run(ContentContext $context): CheckResult
{
$clickbait = str_contains(mb_strtolower($context->title), 'you won\'t believe');
return new CheckResult(
$this->id(),
$this->group(),
$clickbait ? Status::Bad : Status::Good,
$clickbait ? 'Avoid clickbait phrasing in titles.' : 'Title looks trustworthy.',
);
}
}
```
```php theme={null}
$report = SeoAnalyzer::analyzer()
->withCheck(new NoClickbaitTitle())
->analyze($context);
```
Groups are `seo`, `readability`, and `geo`; anything else is ignored by the score panels.
## Cross-record reports
All the cross-record logic lives in framework-free, unit-tested engines (`src/Cannibalization`, `src/Linking`, `src/Redirects`, `src/Language`, `src/Keyphrase`).
### Redirect manager (404 capture + one-click 301s)
Register the middleware in `bootstrap/app.php`:
```php theme={null}
use Usamamuneerchaudhary\FilaRank\Http\Middleware\HandleRedirects;
->withMiddleware(function (Middleware $middleware) {
$middleware->web(append: [HandleRedirects::class]);
})
```
The middleware serves matching redirects (with normalisation, chain-following A→B→C, and loop protection) and logs every 404. Logged 404s appear on the **SEO Health** page with a one-click "Create redirect" link that pre-fills the source path. Rules are cached for an hour and the cache is busted automatically on create/edit/delete.
Slug changes on published records create a 301 automatically. Reverting a slug clears the reverse rule, so renaming back and forth can't leave a redirect loop behind. Configure with:
```php theme={null}
'redirects' => [
'auto_on_slug_change' => true,
'only_when_published' => true,
],
```
### Internal linking suggestions & orphaned content
The SEO Health dashboard reports **orphaned content** (pages nothing links to) and **under-linked cornerstones**. The link graph compares URLs by normalised path, so absolute and relative links to the same page match. Programmatic access:
```php theme={null}
$graph = app(\Usamamuneerchaudhary\FilaRank\Reports\SeoReports::class)->linkGraph();
$graph->orphans();
$graph->suggestionsFor($record); // keyphrase-based, cornerstone-boosted
$graph->underlinkedCornerstones(3);
```
### Keyword cannibalization warnings
Any keyphrase targeted by more than one record is flagged, sorted most-contested first. Keywords are normalised (case- and slug-insensitive), so "Coffee Beans", "coffee beans", and "coffee-beans" collide. Includes each record's primary **and** related keyphrases.
### Cornerstone content flagging
A **Cornerstone content** toggle in the SEO section marks your most important pages. Cornerstone records are held to a higher bar by the `cornerstone-depth` check (≥900 words, properly subheaded) and flagged on the dashboard when too few internal links point to them (`config('filarank.cornerstone.min_incoming_links')`).
### Multiple focus keywords
A **Related keyphrases** tags field lets each record target secondary phrases. The primary keyword gets the full analysis; each related keyphrase gets the keyword-specific SEO checks (title / meta / slug / first paragraph / density / subheadings), shown in the analysis panel. Duplicates of the primary are de-duplicated automatically.
```php theme={null}
use Usamamuneerchaudhary\FilaRank\Keyphrase\KeyphraseAnalyzer;
$results = (new KeyphraseAnalyzer())->analyze($context); // primary first, then related
```
### Per-language readability packs
Readability heuristics (transition words, passive-voice detection, syllable counting, reading-ease formula) sit behind a `LanguagePack` interface. English, Dutch, French, German, and Spanish ship in the box. The content-language selector is hidden unless `FILARANK_MULTILINGUAL=true`. Add your own:
```php theme={null}
use Usamamuneerchaudhary\FilaRank\Language\LanguageRegistry;
app(LanguageRegistry::class)->register(new FrenchPack());
```
Extend `AbstractLanguagePack` and implement `transitionWords()`, `countSyllables()`, and the passive-voice word lists, see `EnglishPack` and `DutchPack` for the pattern.
## Styling
The panel UI is built from native Filament components plus hand-written `filarank-*` classes layered on Filament's design tokens, inlined once per process. There is no Tailwind build step and no `viteTheme` requirement, the plugin looks right in any panel, light or dark, out of the box.
## Testing
```bash theme={null}
composer test # Pest (Laravel integration, requires composer install)
composer test:standalone # both engine suites, zero dependencies, just PHP
```
## License
Commercial. One license covers one production project (its development and staging environments included). Purchase at [Anystack](https://checkout.anystack.sh/filarank-pro/a22ff325-a480-49c5-bd18-8e9c01990f79).
## Support
Email [hello@usamamuneer.me](mailto:hello@usamamuneer.me).
Full documentation: [docs.filarank.com](https://docs.filarank.com)
# Redirect Manager & 404 Capture
Source: https://docs.filarank.com/redirect-manager
Log 404s in Laravel, create 301 redirects from the Filament SEO Health dashboard, and auto-redirect on slug change.

`HandleRedirects` is registered on the web stack automatically. Set `FILARANK_AUTO_REDIRECTS=false` (or `redirects.auto_register_middleware`) to opt out.
If you already append it in `bootstrap/app.php`, remove the duplicate so 404s are not logged twice:
```php theme={null}
use Usamamuneerchaudhary\FilaRank\Http\Middleware\HandleRedirects;
->withMiddleware(function (Middleware $middleware) {
$middleware->web(append: [HandleRedirects::class]);
})
```
Publish and run the redirect migration (the installer does this for you), then register the plugin on your panel:
```php theme={null}
->plugin(\Usamamuneerchaudhary\FilaRank\FilaRankPlugin::make())
```
The middleware serves matching redirects (with normalisation, chain-following A→B→C, and loop protection) and logs every 404. Logged 404s appear on the **SEO Health** page with a one-click **Create redirect** link that pre-fills the source path. Rules are cached for an hour and the cache is busted automatically on create/edit/delete.
## Auto-redirects on slug change
Slug changes on published records create a 301 automatically. Reverting a slug clears the reverse rule, so renaming back and forth can't leave a redirect loop behind.
```php theme={null}
'redirects' => [
'auto_on_slug_change' => true,
'only_when_published' => true,
],
```
Override `HasSeo::isSeoPublished()` if your model uses a different published flag than `published_at` or a `status` of `published` / `live` / `public`.
Pair redirects with [Internal Linking](/internal-linking) and [Keyword Cannibalization](/cannibalization) reports on the same SEO Health dashboard to fix crawl and ranking issues in one place.
# XML sitemap
Source: https://docs.filarank.com/sitemap
Generate a /sitemap.xml index from scanned models, skip noindex records, and keep /filarank-sitemap.xml as a 301.
Enable the sitemap in **SEO Settings**. While it's off, the route returns 404 rather than an empty document. Entries are built from your [scanned models](/configuration#scanned-models), skipping records flagged `noindex`, unpublished, or without a public URL.
Implement `getSeoUrl()` on each model so the sitemap emits real paths:
```php theme={null}
public function getSeoUrl(): ?string
{
return route('posts.show', $this, absolute: false);
}
```
## Index, images, HTML
v3 serves a **sitemap index** at `/sitemap.xml` by default. Child files are `/sitemap-{model}.xml` plus `/sitemap-images.xml` when image URLs exist. `/sitemap.html` is a human-readable list. The old `/filarank-sitemap.xml` path **301s** to `/sitemap.xml`.
Per-model changefreq, priority, and include flags live on `scanned_models`:
```php theme={null}
'scanned_models' => [
\App\Models\Post::class => [
'label' => 'title',
'changefreq' => 'weekly',
'priority' => 0.8,
'sitemap' => true,
],
],
```
## Config
```php theme={null}
'sitemap' => [
'enabled' => true,
'path' => 'sitemap.xml',
'legacy_path' => 'filarank-sitemap.xml',
'index' => true,
'images' => true,
'html' => true,
'changefreq' => 'weekly',
'priority' => 0.5,
'cache_seconds' => 3600,
'ping' => false,
'ping_endpoints' => [
'https://www.bing.com/ping?sitemap={sitemap}',
],
],
```
Set `index` to `false` if you want a single urlset at `/sitemap.xml` instead of an index.
Google retired its ping endpoint in 2023. Prefer [IndexNow](/indexnow) for notifying Bing. `sitemap.ping` remains for engines that still accept a ping URL.
> [!NOTE]
>
> `sitemap.ping_on_save` was removed in v2. The Settings toggle is `sitemap.ping`.
# Structured data
Source: https://docs.filarank.com/structured-data
Emit a multi-node JSON-LD @graph with Organization, WebSite, BreadcrumbList, Article, FAQ, Product, LocalBusiness, and more.
`` renders JSON-LD as a multi-node `@graph` instead of a single type. Types are an extensible registry in v3, not a hardcoded list. Toggle nodes in config or from **SEO Settings**:
```php theme={null}
'render' => [
'schema_types' => [
'organization' => true,
'website' => true,
'breadcrumb' => true,
'article' => true,
'faq' => true,
'product' => false,
'webpage' => false,
'local_business' => false,
'person' => false,
'event' => false,
'howto' => false,
'video' => false,
],
],
```
Per-record `schema_type` and `custom_json_ld` override the defaults. Knowledge Graph fields (legal name, logo, sameAs, NAP, geo, per-day opening hours) feed Organization / LocalBusiness nodes. See [Title templates and social](/title-templates) for visible breadcrumbs.
## Entity graph: stable `@id`s (v3.1)
Since v3.1 the Organization and WebSite nodes carry stable `@id`s, so the whole `@graph` references the same entities instead of re-describing them:
* Organization: `{your app.url}/#organization`
* WebSite: `{your app.url}/#website`
The Article node's `publisher` now points at the Organization by reference, `"publisher": {"@id": "https://example.com/#organization"}`, instead of embedding a second copy of the organization object. If you build or post-process JSON-LD yourself, resolve IDs with `KnowledgeGraph::organizationId()` and `KnowledgeGraph::websiteId()`.
> [!NOTE]
>
> Invalid `custom_json_ld` is rejected by form validation when you save (also since v3.1), rather than being silently dropped when the page renders.
## FAQ and Product nodes
Models can contribute their own schema data by implementing a contract:
```php theme={null}
use Usamamuneerchaudhary\FilaRank\Schema\Contracts\HasFaqSchema;
class Post extends Model implements HasFaqSchema
{
/** @return list */
public function getFaqItems(): array
{
return $this->faqs->map(fn ($faq) => [
'question' => $faq->question,
'answer' => $faq->answer,
])->all();
}
}
```
```php theme={null}
use Usamamuneerchaudhary\FilaRank\Schema\Contracts\HasProductSchema;
class Product extends Model implements HasProductSchema
{
/** @return array */
public function getProductSchema(): array
{
return [
'name' => $this->name,
'sku' => $this->sku,
'offers' => [
'@type' => 'Offer',
'price' => $this->price,
'priceCurrency' => 'USD',
],
];
}
}
```
FAQ structure in the body also feeds the `faq-structure` GEO check. See [GEO / AEO scoring](/geo-aeo).
# Technical audit
Source: https://docs.filarank.com/technical-audit
Crawl your own pages for missing meta, broken status codes, absent JSON-LD, and images without alt text.
**SEO Health → Technical audit** crawls the public URL of every record with SEO meta and reports missing titles, meta descriptions, canonicals, OG images, and focus keywords, plus broken status codes, absent JSON-LD, and images without alt text.
Each issue can be turned into a numbered remediation plan with [AI](/ai).
## Queued by default (v3.1)
Since v3.1, **Run technical audit** and **Re-run analysis** on SEO Health no longer crawl inside the panel request. They dispatch `RunSiteAuditJob` / `RefreshSeoScoresJob` to your queue instead:
* Only one audit (or score refresh) runs at a time: the jobs are unique, and are retried twice with backoff (60s, then 300s).
* The outcome is recorded (status, start/finish times) and summarised on SEO Health with the last run's status and scanned/issue counts. Failures are logged and stored, not swallowed.
* You need a running queue worker (`php artisan queue:work`). Keep `audit.job_timeout` shorter than your queue connection's `retry_after` so a worker never reserves the same audit twice.
Prefer the old inline behaviour? Turn the queue off and both actions run synchronously again:
```php theme={null}
'audit' => [
'queue' => false,
],
```
## Run from the CLI, or nightly
Queue an audit without opening the panel:
```bash theme={null}
php artisan filarank:audit
```
To run it every night, enable the schedule (off by default). The panel button and the artisan command always work either way:
```php theme={null}
'audit' => [
'schedule' => env('FILARANK_AUDIT_SCHEDULE', false),
'schedule_at' => env('FILARANK_AUDIT_SCHEDULE_AT', '02:00'),
],
```
Make sure your app's scheduler (`php artisan schedule:run` via cron) is running.
## hreflang checks (v3.1)
Records that implement `HasHreflang` get their locale map validated on every audit:
```php theme={null}
use Usamamuneerchaudhary\FilaRank\Schema\Contracts\HasHreflang;
class Post extends Model implements HasHreflang
{
/** @return array Locale => absolute URL, plus `x-default` when you have a fallback. */
public function getSeoHreflang(): array
{
return [
'en' => 'https://example.com/en/posts/hello',
'de' => 'https://example.com/de/posts/hallo',
'x-default' => 'https://example.com/en/posts/hello',
];
}
}
```
| Issue type | Severity | Meaning |
| - | - | - |
| `hreflang_relative_url` | warning | An entry is a relative URL: hreflang values must be absolute. |
| `hreflang_missing_self` | warning | The map does not include the page's own URL. |
| `hreflang_missing_x_default` | info | The map has no `x-default` fallback entry. |
## Safety
The crawler only fetches URLs on your own `app.url` host. Extra hosts must be allow-listed **and** must resolve to public addresses, which stops a careless `getSeoUrl()` from pointing the crawler at internal services or cloud metadata endpoints. Blocked URLs are recorded as an `unsafe_url` issue so the meta checks still run and you can see why the fetch was skipped.
Redirects mid-request to untrusted hosts are refused.
```php theme={null}
'audit' => [
'allowed_hosts' => ['docs.example.com'],
'max_pages' => 500,
'delay_ms' => 0, // throttle between requests
],
```
Runs are bounded by `max_pages` and atomic: issues are collected in memory and swapped in one transaction, so a crawl that dies halfway leaves your existing issue list intact.
Implement `getSeoUrl()` so the crawler hits the public page rather than a guessed slug path. See [Usage](/usage).
# Title templates and social
Source: https://docs.filarank.com/title-templates
Site-wide title templates, empty-title fallback, and Open Graph / X overrides with live previews.
## Title templates
Empty stored titles are not a blank ``. FilaRank renders the site template instead:
```php theme={null}
'templates' => [
'title' => '{{title}} {{sep}} {{site}}',
'description' => null,
'titles' => [
// \App\Models\Post::class => '{{title}} {{sep}} Blog {{sep}} {{site}}',
],
'descriptions' => [],
],
```
Tokens:
| Token | Source |
| - | - |
| `{{title}}` | Per-record SEO title, then the model's title/name fallback |
| `{{sep}}` | `site.title_separator` |
| `{{site}}` | `site.name` |
| `{{excerpt}}` | Model excerpt when present |
| `{{primary_keyword}}` | Focus keyword |
Per-model templates in `titles` / `descriptions` override the site defaults. You can also edit the site template from **SEO Settings** or the [setup wizard](/quickstart).
## Social tab
`SeoFields` includes a **Social** tab:
* Open Graph title and description
* X / Twitter title and description
* Share image upload
* Facebook and X previews next to the Google snippet
Columns: `og_title`, `og_description`, `twitter_title`, `twitter_description` (added by the v3 migration).
## Breadcrumbs
Visible trail that matches BreadcrumbList JSON-LD:
```blade theme={null}
```
Override the trail on a model with `getSeoBreadcrumbs()` returning `list`.
## Related
* [Structured data](/structured-data)
* [Wire SEO fields](/usage)
* [FilaRank configuration](/configuration)
# Upgrade to v3
Source: https://docs.filarank.com/upgrading
Publish v3 migrations, move the sitemap to /sitemap.xml, and pick up robots.txt, llms.txt, IndexNow, and bulk SEO.
FilaRank 3.0 is crawl control and on-page templates that Rank Math / Yoast treat as table-stakes, without GSC or GA4 OAuth. Existing `HasSeo`, `SeoFields::make()`, and `SeoScoreColumn::make()` calls keep working.
## Upgrading to 3.1
3.1 is background processing and schema-graph polish: **no migrations, no new dependencies, no breaking changes**: just update the package.
* **Queued technical audit.** SEO Health's **Run technical audit** and **Re-run analysis** now dispatch jobs instead of crawling in the panel request, and `php artisan filarank:audit` queues an audit from the CLI (optional nightly schedule, off by default). Make sure a queue worker is running, or set `'queue' => false` under `audit` in `config/filarank.php` to restore the old inline behaviour. See [Technical audit](/technical-audit).
* **hreflang audit checks.** Records implementing `HasHreflang` are flagged for relative URLs, a missing self-reference, or a missing `x-default`. See [Technical audit](/technical-audit#hreflang-checks-v31).
* **Schema entity graph.** Organization and WebSite JSON-LD nodes now carry stable `@id`s (`/#organization`, `/#website`), and the Article `publisher` references the Organization by `@id`. See [Structured data](/structured-data#entity-graph-stable-ids-v31).
* Invalid `custom_json_ld` is now rejected by form validation instead of being silently dropped at render time.
* SEO Overview now uses aggregate queries, noticeably faster on large catalogues, with no visible change.
**1. Run the upgrade command**
```bash theme={null}
php artisan filarank:upgrade
```
That publishes the v3 migration and prints the breaking-change notes. Then:
```bash theme={null}
php artisan migrate
```
This adds `schema_type`, social override columns, and `custom_json_ld` on `seo_metas`, `is_regex` on redirects, plus `filarank_robots_revisions`, `filarank_seo_revisions`, and `filarank_locations`.
**2. Point at /sitemap.xml**
Change `sitemap.path` to `sitemap.xml` if you published the config. `/filarank-sitemap.xml` 301s to the new path. See [XML sitemap](/sitemap).
**3. Delete public/robots.txt**
A static `public/robots.txt` is served by the web server and shadows FilaRank's virtual `/robots.txt`. Delete it. See [robots.txt and llms.txt](/crawl-files).
**4. HandleRedirects**
The middleware is registered on the web stack automatically. Set `FILARANK_AUTO_REDIRECTS=false` (or `redirects.auto_register_middleware`) to opt out.
If `bootstrap/app.php` already appends `HandleRedirects`, remove the duplicate so 404s are not logged twice.
**5. Re-diff the config**
Publishing the config replaces nested keys such as `ai.providers` wholesale (`mergeConfigFrom` merges only top-level keys). Diff rather than overwrite if you customized providers:
```bash theme={null}
php artisan vendor:publish --tag=filarank-config --force
```
New top-level keys: `files`, `indexnow`, `templates`, `multilingual`, `knowledge`.
**6. Turn on the new pages**
Every page still defaults to on. Hide the ones you do not want:
```php theme={null}
FilaRankPlugin::make()
->files()
->indexing()
->bulkEditor()
->setupWizard()
```
## What else changed in v3
* [Title templates](/title-templates): empty stored titles render `{{title}} {{sep}} {{site}}`
* [Social tab](/title-templates): OG/X overrides and Facebook + X previews
* [Bulk SEO](/bulk-seo): modal editor, CSV, GSC CSV import, IndexNow submit
* [IndexNow](/indexnow): automatic on save, same-host only
* Schema registry: LocalBusiness, Person, WebPage, Event, HowTo, VideoObject, plus per-record `schema_type` and custom JSON-LD
* Knowledge Graph: legal name, logo, sameAs, NAP, geo, per-day opening hours
* ``
* French, German, and Spanish readability packs. Content-language UI stays hidden unless `FILARANK_MULTILINGUAL=true`
* Mistral and DeepSeek AI providers
* Redirects gain regex matching and CSV import/export
## Coming from v1
v2 added AI, sitemaps, the technical audit, keyword research, rank tracking, backlinks, and competitors. If you are still on v1, run `php artisan vendor:publish --tag=filarank-migrations` and `php artisan migrate` so the v2 tables exist *before* the v3 migration. There are still no breaking API changes on `HasSeo` / `SeoFields` / `SeoScoreColumn`.
If you were relying on `sitemap.ping_on_save`, move to the `sitemap.ping` toggle. That redundant key was removed in v2.
# Wire SEO Fields in Filament
Source: https://docs.filarank.com/usage
Add HasSeo, SeoFields, SeoScoreColumn, and the tags Blade component to your Filament resources and frontend.

**1. Prepare your model**
```php theme={null}
use Usamamuneerchaudhary\FilaRank\Concerns\HasSeo;
class Post extends Model
{
use HasSeo;
}
```
By default the analyzer reads the model's `content` and `slug` attributes and falls back to `title` for the page title. Override if your columns differ:
```php theme={null}
public function getSeoContent(): ?string
{
return $this->body;
}
public function getSeoSlug(): ?string
{
return $this->permalink;
}
/** Public URL, used by the sitemap, link graph, and technical audit. */
public function getSeoUrl(): ?string
{
return route('posts.show', $this, absolute: false);
}
```
**2. Add the SEO section to your Filament form**
```php theme={null}
use Usamamuneerchaudhary\FilaRank\Forms\SeoFields;
public static function form(Schema $schema): Schema
{
return $schema->components([
TextInput::make('title'),
TextInput::make('slug'),
RichEditor::make('content'),
SeoFields::make(), // assumes `content` + `slug` fields on this form
]);
}
```
If your body field has a different name, or lives somewhere unusual in the schema tree:
```php theme={null}
SeoFields::make(contentField: 'body', slugField: 'permalink');
// or take full control of where values are read from and written to:
SeoFields::make(
getContentUsing: fn (Get $get) => $get('../body'),
getSlugUsing: fn (Get $get) => $get('../permalink'),
setSlugUsing: fn (string $value, Set $set) => $set('../permalink', $value),
);
```
> [!NOTE]
>
> `SeoFields::make()` binds to the `seo` relationship, so it must be used on a form with a record model that uses `HasSeo`.
**3. Show the score in your table**
```php theme={null}
use Usamamuneerchaudhary\FilaRank\Tables\SeoScoreColumn;
public static function table(Table $table): Table
{
return $table->columns([
TextColumn::make('title'),
SeoScoreColumn::make(),
]);
}
```
Scores are recalculated and stored whenever the model is saved (disable with `'persist_score' => false`).
**4. Render the tags on your frontend**
In your layout's ``:
```blade theme={null}
```
See [Title templates and social](/title-templates) for empty-title fallbacks and OG/X overrides.
Or for static pages without a model:
```blade theme={null}
```
**5. Analyze anything programmatically**
```php theme={null}
use Usamamuneerchaudhary\FilaRank\SeoAnalyzer;
$report = SeoAnalyzer::analyze([
'title' => 'Coffee Beans Guide',
'description' => '…',
'focus_keyword' => 'coffee beans',
'slug' => 'coffee-beans',
'content' => $html,
]);
$report->score(); // 0–100 or null
$report->seoScore();
$report->readabilityScore();
$report->geoScore();
$report->rating(); // Status::Good | Ok | Bad
$report->results; // list of CheckResult
```
Or against a model directly: `SeoAnalyzer::analyzeModel($post)`.
See [FilaRank Configuration](/configuration) for site-wide defaults, disabled checks, and score persistence. To add your own analysis rules, see [Custom SEO Checks](/custom-checks).