Title & Meta Description Analyzer Tool

Script Verification: This Python automation workflow is tested and fully compatible with Python 3.10 through Python 3.12. Ensure your requirements.txt dependencies (like BeautifulSoup4 and requests) are updated.

This Python script crawls every URL from your sitemap and checks three critical on-page SEO elements: title tags, meta descriptions, and their character lengths. It flags titles over 60 characters, missing meta descriptions, and descriptions over 160 characters — then exports the results as a structured report. Run it as a standalone audit or incorporate it into the full Google Apps Script SEO audit suite.

Click the following link to open the Python Script: Title/Meta Description Analyzer

How the Title and Meta Description Analyzer Script Works

The Python script provided in this article is a powerful tool designed to analyze the critical elements of a website – its URLs, titles, and meta descriptions. Let's break down the script's functionality step by step. For complementary on-page checks, see the heading tag hierarchy checker and the schema markup checker.

  1. Retrieving URLs from a Sitemap

The script starts by prompting the user to input a sitemap URL, which is essentially a file that contains a list of URLs on a website. The script then sends a request to the provided sitemap URL and extracts the URLs from the XML content using the xml.etree.ElementTree library. These URLs will be the basis for further analysis.

  1. Extracting Title and Meta Description Information

The script uses the requests library to send HTTP requests to each URL extracted from the sitemap. It then parses the HTML content of each URL using the BeautifulSoup library, enabling the extraction of crucial information such as titles and meta descriptions. Titles are extracted from the <title> tags, while meta descriptions are obtained from the <meta> tags with the name attribute set to "description."

  1. Analyzing URL Content

The script computes several attributes for each URL:

  1. Parallel Processing for Efficiency

To expedite the analysis process, the script employs the concurrent.futures.ThreadPoolExecutor class. This class allows multiple URLs to be analyzed simultaneously, enhancing the speed of data retrieval and processing.

  1. Creating a DataFrame and Visualizing Data

The script utilizes the pandas library to create a DataFrame that organizes the extracted information. This DataFrame holds valuable insights, making it easier to identify errors and patterns in the website's content. The script then generates two output files, one in CSV format and the other in Excel format, containing the DataFrame's contents.

  1. Highlighting Issues in Excel

The Excel output file is loaded using the openpyxl library, and conditional formatting is applied to highlight potential issues:

Keep Titles Under 60 Characters and Meta Descriptions Under 160

Optimizing a website's URLs, titles, and meta descriptions is a fundamental SEO practice that directly impacts search engine visibility and user engagement. The Python script discussed in this article provides a comprehensive solution for automating the analysis of these critical elements. By identifying and addressing issues such as duplicate content, incorrect or missing information, and discrepancies between titles and meta descriptions, website owners and SEO professionals can significantly enhance the effectiveness of their online presence. This script not only streamlines the optimization process but also empowers users with valuable insights to make informed decisions about their website's content.