Question

We have struggled with junior staff members allowing code to get to production without being adequately checked for SEO.

Are there any good options to add some checks to a build process? We're already using Grunt and Jenkins so ideally we would be able to add a task as a last line of defence in our build process. Are there any libraries that could help?

Was it helpful?

Solution

As far as I'm aware, there aren't any tools available to run this in a build context such as Grunt. The only thing that I've come across in a quick npm search is webcheck, a crawler that can register various middleware and generate a JSON report for you. I'm not aware of any grunt wrapper for this module, but if you find it fits your needs then it might be worth a shot. It looks like the seo reporter in that module reports on keywords which is pretty interesting.

If you decide to write your own module, one of webcheck's dependencies is crawl, which could help you validate pages on your own site against some of those rules. The ones that I would aim for are:

  • Page access - Keep an index of pages you expect to hit and make sure they don't 404.
  • Page blocking - Make sure that unlisted pages have nofollow on them.
  • Pagination - Checking for rel="prev" is trivial.
  • Page speed - Grunt plugin already for this - https://npmjs.org/package/grunt-pagespeed
  • Duplicate content issues (not sure exactly how you'd handle this one though, would be interesting to see) - maybe using https://npmjs.org/package/diff
  • www or non-www - Make sure you use www.example.com instead of example.com and be consistent
  • Descriptive URLs - check them against keywords in title/h1 tags?
  • Impose 70 character limit on titles
  • Content length - make sure your articles aren't spammy 50 word posts
  • Alt tag on images - use HTMLHint (there is also grunt-htmlhint)

I'd hope that you are already using a sitemap generator of some kind, either with something like WordPress which will do it automatically, or as part of your build. If not you can use this one: https://npmjs.org/package/grunt-sitemap

Would really like to see something like this, could be a fun project if you've got some spare time for it. :-)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top