SEO Application: Checking Status codes of your Website's url

Today I was xploring the n8n https node and one of the features therein is return the response code.
For those familiar with SEO, different status codes represent different status of your website.
301 and 302 are redirects
404 page not found
200 the page is okay and
500 means internal error.

With this information, you can do a full Status code check especially for all internal links. All you need is the sitemap/sitemap url for your target website for an easier start.

Next you are going to use the XML node to get the individual URL since n8n returns the data as below

<?xml version="1.0" encoding="UTF-8"?>\n<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">\n  <url><loc>https://www.apple.com/</loc></url>\n  <url><loc>https://www.apple.com/accessibility/</loc></url>\n  <url><loc>https://www.apple.com/accessibility/assistive-technologies/</loc></url>\n  <url><loc>https://www.apple.com/accessibility/cognitive/</loc></url>\n  <url><loc>https://www.apple.com/accessibility/hearing/</loc></url>\n  <url><loc>https://www.apple.com/accessibility/mobility/</loc></url>\n  <url><loc>https://www.apple.com/accessibility/speech/</loc></url>\n  <url><loc>https://www.apple.com/accessibility/the-lost-voice/</loc></url>\n  <url><loc>https://www.apple.com/accessibility/vision/</loc></url>\n  <url><loc>https://www.apple.com/airplay/</loc></url>\n  <url><loc>https://www.apple.com/airpods-2nd-generation/</loc></url>\n  <url><loc>https://www.apple.com/airpods-2nd-generation/compare/</loc></url>\n  <url><loc>https://www.apple.com/airpods-2nd-generation/specs/</loc></url>\n  <url><loc>https://www.apple.com/airpods-3rd-generation/</loc></url>\n  <url>

Once you get the individual URLs, just run them through

  1. The IF node to get all pages that are not 200
    or
  2. A switch node with the different different status as the output routes

I would recommend using this IF Node nodes.
They provide the option to count your output in the filters as a third node for easy calculations

There you have it. Simple Status code checker, with no code, just HTTP requests node

Here is the sample workflow to get you started

3 Likes

Somewhere on the forum is a workflow, which let´s you 301/302 urls you’re being redirected to. <3

I´ll sehr tomorrow for it and post it here.

1 Like

here, we go:

https://community.n8n.io/t/output-all-redirect-headers-and-their-status-codes/9353/2

2 Likes