top of page

Unlocking SEO Potential: Anchor Text Analysis and Page Title Quality Assessment

  • Writer: Nadav Harari
    Nadav Harari
  • Oct 2, 2023
  • 2 min read

Updated: Oct 31, 2023

Are you still relying on gut feeling when it comes to anchor text optimization? What if you could apply machine learning to take the guesswork out of it? In this article, we're diving into the future of anchor text analysis—a future where data, not intuition, drives decisions. Leveraging huggingface's cutting-edge machine learning model, trained on billions of sentence pairs, we've developed a Python-based method that quantifies the quality of the relationship between your anchor texts and their destination page titles. We're talking about scores that range from 0 to 1, pinpointing exactly how well your anchor text correlates with the title tag of the landing page. This is next-level stuff designed for SEO professionals who are serious about fine-tuning their strategies. Ready to get ahead of the curve? Let's get started.


Why is anchor text important for SEO?


Anchor text provides context to both search engines and users.


According to John Muller: Google’s John Mueller recommended this for internal link anchor text:


"With regards to internal links you’re giving us a signal of context. So basically you’re saying, in this part of my website you’ll find information about this topic.


Why should you use this Python script to optimize your anchor texts?


Whether you've just onboarded a new SEO client or are looking to review your existing website, conducting a bulk anchor text "context analysis" simplifies the process of determining if an existing anchor text genuinely relates to the page it links to. For instance, a source page with the anchor text "click here" that leads to a destination page titled "best golf clubs for senior golfers" will yield a low similarity score. Here's a link to the Huggingface sentence transformer model I utilized, where you can experiment with comparing sentences in a no-code environment.


When running the script, upload a txt file with the URLs you want to analyze. Once the script completes, you will receive an output CSV file containing the analysis results.


What tools were used for this analysis?


I utilized Python libraries like BeautifulSoup, cloudscrape, and Pandas in Google Colab, as well as Huggingface's Sentence Transformer.



Setting Up the Environment: [Easy Steps]


1. Click on the button above and run the script in Google Colab by clicking the play button:

ree

2. You will be prompted by the script to upload a file. 3. Upload a simple txt file containing the URLs for which you want to analyze the relationship between their anchor text and title tags. 4. The script will then process the file. 5. The output will be a CSV file with the following columns: Column A: Source URL Column B: Destination URL Column C: Anchor Text Column D: Destination Page Title Column E: Similarity Score (Resulting from the comparison of the anchor text in Column C to the Destination Page Title in Column D)



Output file with the results
Output file with the results

Analyzing the Results:


After opening the output CSV file, it's best to use the "custom sort" feature to pinpoint immediate opportunities:



Once the results are sorted, you can swiftly identify anchor texts with the lowest similarity scores to their destination URL titles and take appropriate action.


FAQ

Do I need to know how to code in order to use this script?

You don't need to know how to code to use this script. Simply run the script, upload a txt file when prompted, and wait for the script to finish. You'll then receive an output CSV file.

Do I need to install anything on my computer to run the script?

No, you don't need to install anything on your PC. Google Colab runs in the cloud, and you can use it for free for this purpose.

Why does the script take so long to run when I upload a txt file with a lot of URLs?

Since the script needs to scrape each URL and each linked URL, it can take a considerable amount of time to process. My advice is to analyze a small set of URLs at a time or to engage in other activities while the script is running.


bottom of page