Configuration
Configure storage drivers, crawling, redirects, analytics, the view composer, and other options in config/advanced-seo.php.
Advanced SEO is configured through config/advanced-seo.php. The config file is automatically published during installation. To publish it manually:
php artisan vendor:publish --tag=advanced-seo-configStorage Driver
Advanced SEO supports two storage drivers: file and eloquent. The File driver stores data as flat-files alongside your content, while the Eloquent driver stores data in a database using the Statamic Eloquent Driver.
File Driver
The File driver is the default. Data is saved in content/seo, but you can customize the directory:
'driver' => 'file',
'directory' => base_path('content/seo'),To switch back to flat-files from Eloquent, run the following command. It will update the config and give you the option to export existing data from the database to flat-files:
php please seo:switch-to-fileEloquent Driver
To use the Eloquent driver, first install the Statamic Eloquent Driver:
composer require statamic/eloquent-driverThen run the following command. It will set the driver in your config to eloquent, publish and run the database migrations, and give you the option to import existing data from flat-files into the database:
GraphQL
Enable the GraphQL API. See GraphQL for available queries and types.
View Composer
Advanced SEO uses a view composer to inject the seo variable into your Antlers and Blade views. This is what makes values like {{ seo:title }} available in your templates. By default, the view composer is applied to all views ('*'). If you want to limit which views receive SEO data:
Social Images
Asset Container
Configure the asset container for social images. Generated images are saved in a social_images directory within the configured container:
Presets
Customize the dimensions of social images:
The open_graph preset defines the generated image size. The twitter_summary and twitter_summary_large_image presets define the dimensions used to resize the shared image for the Twitter meta tags via Glide.
Generator
The generator automatically creates social images from customizable Antlers templates. See Social Images Generator for full setup instructions.
Favicons
The favicons feature renders favicon meta tags from the SVG uploaded in site defaults. You can disable it if you manage favicons yourself:
Crawling
The crawling config controls which environments allow search engine crawling. By default, crawling is only enabled for the production environment:
In all other environments:
The robots meta tag is set to
noindex, nofollowCrawling-related meta tags like
canonicalandalternateare removedSitemap routes are disabled
Sitemaps
Domain-scoped XML sitemaps are generated automatically. See Sitemaps for details.
Redirects
Redirects ship disabled. Enabling the feature activates redirect handling and automatic redirect generation:
Disabling the feature removes its Control Panel navigation and stops redirect handling, hit tracking, error tracking, and automatic generation.
Storage
With the File driver, redirects are stored in content/redirects. Hit and error records live in storage by default:
These directory options are ignored when using the Eloquent driver. Redirects, hits, and errors are stored in their corresponding database tables instead.
Hit Tracking
Hit tracking records how often each redirect is used and when it was last hit. It includes 410 Gone responses.
Set enabled to false to stop recording hits. Existing statistics are preserved.
Error Tracking
Error tracking records frontend paths that return an unhandled 404:
enabled— Show the error inbox and record unhandled 404s.purge_after_days— Delete errors not seen within this many days. Set tofalseto disable age-based pruning.max_records— Keep the most-hit errors up to this limit. Set tofalsefor no limit.ignore— Exact paths, wildcards, or regex patterns that should never be recorded.
The daily seo:prune-redirect-errors command applies retention, deletes handled errors, and enforces the record cap. The cap is best-effort during concurrent requests and may be briefly exceeded before the next write or prune.
Queue
Redirect hits and errors are recorded through queued jobs. Choose the queue name:
When using an asynchronous queue connection, make sure a queue worker processes this queue.
Analytics
Analytics scripts only render in the configured environments. Defaults to production:
You can also disable individual trackers to remove their section from the site defaults:
Site Verification
Site verification adds Google and Bing verification code fields to the site defaults. Disable it to remove those fields:
Tokens
Register custom token normalizers and value tokens. See Tokens for details.
AI
See AI Copywriting for setup and configuration.
Last updated