Elder.js Plugin: SEO Check
Checks the generated HTML for more than 50 common SEO issues along with tips on fixing them.
Works in single page mode and site wide mode.
Pro users can easily use this plugin to fire off an email to the marketing/content team any time an SEO issue is encountered.
SEO Checks
This plugin is very opinionated based on years of Nick Reese's experience running major SEO assets.
If you think the rules are too strict or opinionated this plugin supports adding your own rules.
Sitewide
These are only checked when Elder.js runs in build mode.
Canonical
Title Tag
Meta Description
HTags
Images
Links
Misc
Install
npm install --save @elderjs/plugin-seo-check
Config
Once installed, open your elder.config.js
and configure the plugin by adding @elderjs/seo-check
to your plugin object.
plugins: {
'@elderjs/plugin-seo-check': {
display: ['errors', 'warnings'],
handleSiteResults: async ({ meta, ...results }) => {
if (Object.keys(results).length > 0) {
console.log(results);
} else {
console.log(`No SEO issues detected.`);
}
},
preferences: [],
rules: [],
},
}
If things are too verbose for dev, try this:
plugins: {
'@elderjs/plugin-seo-check': {
display: process.NODE_ENV === 'production' ? ['errors', 'warnings']: [],
},
},
}
For access to the default rules and preferences:
const { defaultPreferences, rules } = require('@elderjs/plugin-seo-check');
Contributing:
- If you end up writing your own rules, if you want to write a how-to that would be great.