brandefy-studio / bolt-enhanced-seo
Enhanced SEO extension for Bolt 5 and 6 with real-time analysis, meta tags, and Google preview
Installs: 10
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 12
Language:JavaScript
Type:bolt-extension
pkg:composer/brandefy-studio/bolt-enhanced-seo
Requires
- php: >=8.1
- twig/twig: ^3.21
Requires (Dev)
- bolt/core: ^5.0|^6.0
- phpstan/phpstan: ^2.1
- phpstan/phpstan-symfony: ^2.0
- rector/rector: ^2.2
- symplify/easy-coding-standard: ^13
README
Enhanced SEO extension for Bolt CMS 5/6 with real-time SEO analysis, comprehensive meta tag management, and Google search preview.
β¨ What's New in v1.1.1
π¨ Improved UX - Cleaner, more intuitive interface!
- Progress Bar at top (instead of sidebar circle)
- Inline Indicators under each field
- Single Column Layout - No more cramped sidebar
- Better Content Detection - Analyzes all content fields
- Mobile Optimized - Perfect on all devices
Features
β Real-time SEO Analyzer β Enhanced in v1.1.1
- Progress bar with live scoring (0-100)
- Inline analysis under each field
- 10 comprehensive SEO checks
- Focus keyphrase optimization
- Clean, uncluttered interface
β
Custom SEO Field Type - Dedicated seo field for all content types
β
Google Search Preview - Real-time SERP preview as you type
β
Meta Tag Management - Title, description, keywords, canonical, robots
β
Open Graph Support - Facebook/LinkedIn social media optimization
β
Multi-language Support - Works with Bolt's localization system
β
Template Integration - Simple Twig functions for frontend output
β
Flexible Configuration - Extensive YAML configuration options
β
No Database Changes - Stores SEO data as JSON in fields
Installation
Via Composer (Recommended)
composer require brandefy-studio/bolt-enhanced-seo
Manual Installation
- Download the latest release
- Extract to
vendor/brandefy-studio/bolt-enhanced-seo - Run
composer dump-autoload
Setup
Step 1: Add SEO Field to ContentTypes
Edit config/bolt/contenttypes.yaml:
pages: name: Pages singular_name: Page fields: title: type: text class: large group: content slug: type: slug uses: title group: content body: type: html group: content # Add SEO field seo: type: seo group: "SEO"
Step 2: Add Meta Tags to Templates
Edit your base template (e.g., templates/base.html.twig):
<!DOCTYPE html> <html lang="{{ app.request.locale }}"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> {# SEO Title #} <title>{{ seo.title() }}</title> {# All SEO Meta Tags #} {{ seo.metatags()|raw }} {# Your other head content #} </head> <body> {{ block('content') }} </body> </html>
Step 3: Clear Cache
php bin/console cache:clear
Usage
Real-time SEO Analyzer (v1.1.0+)
The SEO Analyzer provides instant feedback as you write content:
SEO Score
- 0-49 (Red) - Needs significant improvement
- 50-79 (Orange) - Good, but can be better
- 80-100 (Green) - Excellent SEO optimization!
10 Automated Checks
- SEO Title Length - Optimal: 30-60 characters
- Meta Description Length - Optimal: 120-160 characters
- Focus Keyphrase in Title - Best at start of title
- Focus Keyphrase in Description - Should appear naturally
- Focus Keyphrase in URL - Improves relevance
- Focus Keyphrase in Content - Use 3+ times naturally
- Keyphrase Density - Optimal: 0.5-2.5% (avoid keyword stuffing)
- Content Length - Minimum 300 words, optimal 800+
- External Links - Link to authoritative sources (1-3 links)
- Internal Links - Link to related pages (2-5 links)
How to Use
- Set Focus Keyphrase: Enter your target keyword/phrase
- Write Content: The analyzer updates as you type
- Check Score: Watch the score circle in the sidebar
- Follow Suggestions: Review the improvement panel
- Optimize: Make changes to improve your score
In Backend
- Edit any content that has the
seofield - Click on the "SEO" tab
- Fill in SEO fields:
- SEO Title - Custom title for search engines (50-60 chars recommended)
- Meta Description - Brief description (120-156 chars recommended)
- Meta Keywords - Comma-separated keywords (optional)
- Google Preview - Live preview of how it appears in search results
- Shortlink - Alias/shortlink for the page
- Canonical Link - Override canonical URL
- Meta Robots - Control indexing (index/noindex, follow/nofollow)
- Open Graph Type - Social media type (website, article, etc.)
In Templates
{# Basic usage #} <title>{{ seo.title() }}</title> {{ seo.metatags()|raw }} {# Individual meta tags #} <meta name="description" content="{{ seo.description() }}"> <meta name="keywords" content="{{ seo.keywords() }}"> <meta name="robots" content="{{ seo.robots() }}"> <link rel="canonical" href="{{ seo.canonical() }}"> {# Open Graph #} <meta property="og:title" content="{{ seo.title() }}"> <meta property="og:description" content="{{ seo.description() }}"> <meta property="og:type" content="{{ seo.ogtype() }}"> <meta property="og:image" content="{{ seo.image() }}">
Configuration
Edit config/extensions/brandefy-bolt-enhanced-seo.yaml:
# Title separator: "Page Title | Site Name" title_separator: "|" # Title postfix (leave empty to use sitename from config) # Set to false to disable postfix title_postfix: '' # Length limits for SEO fields title_length: 70 description_length: 158 keywords_length: 0 # Set to 255 to enable keywords field # Default fields to use for SEO data fields: slug: ['slug'] title: ['title', 'name'] description: ['introduction', 'teaser', 'description', 'body'] keywords: [] image: ['image'] # Default values default: title: "" description: "" keywords: "" ogtype: "website" robots: "index, follow" # Override defaults for specific routes #override_default: # homepage: # title: 'Custom Homepage Title' # description: 'Custom Description' # robots: 'index, follow' # ogtype: 'website' # canonical: 'https://example.com' # Custom template for meta tags output #templates: # meta: _partials/_metatags.html.twig
API Reference
Twig Functions
seo.title()
Returns the SEO title with optional postfix.
Priority:
- Override configuration for route
- SEO field
titlevalue - Content
titlefield - Default title from config
- Site name from Bolt config
seo.description()
Returns the meta description, trimmed to configured length.
Priority:
- Override configuration
- SEO field
descriptionvalue - Content description/teaser/intro field
- Default description
- Site payoff from Bolt config
seo.keywords()
Returns meta keywords (if enabled).
seo.canonical()
Returns the canonical URL.
Priority:
- Override configuration
- SEO field
canonicalvalue - Default canonical from config
- Current request URI
seo.robots()
Returns robots meta directive.
Priority:
- Override configuration
- SEO field
robotsvalue - Default robots from config
"index, follow"
seo.image()
Returns OG image URL.
Priority:
- Override configuration
- Content image field
- Default image from config
seo.ogtype()
Returns Open Graph type.
Priority:
- Override configuration
- SEO field
ogvalue - Default ogtype from config
"website"
seo.metatags()
Outputs all meta tags using the configured template.
Customizing Meta Tags Output
To customize the meta tags template:
- Copy
vendor/brandefy-studio/bolt-enhanced-seo/templates/_metatags.html.twigto your theme - Edit
config/extensions/brandefy-bolt-enhanced-seo.yaml:templates: meta: _partials/_metatags.html.twig
- Customize your template
Multi-language Support
The extension works seamlessly with Bolt's localization:
# config/bolt/config.yaml locales: en: label: English slug: en fr: label: FranΓ§ais slug: fr # config/bolt/contenttypes.yaml pages: fields: title: type: text localize: true seo: type: seo group: "SEO" # SEO data is automatically localized
Troubleshooting
SEO Tab Not Showing
- Verify field is added to contenttype:
seo: type: seo group: "SEO"
- Clear cache:
php bin/console cache:clear - Check field type is registered (should auto-register)
Meta Tags Not Appearing
- Verify templates include
{{ seo.metatags()|raw }} - Check that content has
seofield - Verify extension is installed:
composer show brandefy-studio/bolt-enhanced-seo
JavaScript/CSS Not Loading
The extension automatically copies assets on installation. If assets are missing:
php bin/console bolt:copy-assets
Or manually copy vendor/brandefy-studio/bolt-enhanced-seo/assets/ to public/assets/
Compatibility
- Bolt CMS: 5.x and 6.x
- PHP: 8.1 or higher
- Browsers: Chrome 90+, Firefox 88+, Safari 14+, Edge 90+
Roadmap
v1.1.0 (Planned)
- Real-time SEO score analysis
- Character count indicators with color coding
- Content length recommendations
v1.2.0 (Planned)
- Readability analysis (Flesch Reading Ease)
- Focus keyphrase analysis
- Enhanced Google SERP preview
v2.0.0 (Future)
- Schema.org markup generator
- Redirect manager
- Sitemap generator
- Content insights dashboard
Migration from AppoloDev/bolt-seo
This extension is a fork of the original AppoloDev/bolt-seo with enhanced features and updated namespace.
Existing installations: Simply update your composer.json:
{
"require": {
"brandefy-studio/bolt-enhanced-seo": "^1.0"
}
}
Run composer update and clear cache. All existing SEO data is preserved.
Contributing
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch
- Make your changes
- Submit a pull request
Credits
- Original Extension: AppoloDev/bolt-seo
- Enhanced By: Brandefy Studio
- Bolt CMS: boltcms.io
License
MIT License - see LICENSE file for details
Support
- Documentation: GitHub Wiki
- Issues: GitHub Issues
- Discussions: GitHub Discussions
Made with β€οΈ by Brandefy Studio