Hi friends, on this occasion I will share about how to check for error links on our website using a tool, that is Linkinator, an error link or website URL will certainly affect the SEO of the website, therefore it is important for us to check the error link on our website so we can fix it.
I’m assuming you already have node.js installed, because we’re going to be running Linkinator here using node.js.
Alright, let’s start right away…
Table of contents :
- Introduction
- Definition of Linkinator
- How to install Linkinator
- How to use Linkinator
- Closing
1.INTRODUCTION
A website must have many links in it that contain many pages, to check it is certainly not easy if the website links are hundreds or even thousands, we need a tool to do this, a tool that is worth trying is the linkinator.
2. DEFINITION OF LINKINATOR
Linkinator is a CLI that has the ability to crawl a website and scan all the links in it and then tell which links are OK and which links are broken.
The CLI was created by “Justin Beckwith” and can be used as a CLI or an API. We only need Node.js to run this Linkinator.
3. HOW TO INSTALL LINKINATOR
We can install Linkinator into our project for later use as an API or we can run Linkinator with NPX to use it directly without needing to install it (explicitly) first.
Open a command prompt by typing CMD then type the command “npm install linkinator” as shown below
if there is no error, will appear as shown above.
4. HOW TO USE LINKINATOR
after we have successfully installed Linkinator, next we will try to use it, type the command “npx linkinator [your_website_url]” as shown below
For the output of this CLI the format is very simple, the format is [HTTP status] URL. If we find a number other than [200], for example [404], [900], or [500]. This means that the URL or link is problematic, either the page does not exist or the page exists but an error (this depends on the HTTP status) as shown below
5. CLOSING
That’s how to check for error links using the Linkinator tool and node.js, hopefully it can be useful.