How to Extract Meta Tags from a Website Using Google Sheets?

Extract Meta Tags Using Google Sheets

Are you doing on page optimization of your website? If yes, so I think meta tags optimization is on top of your task list. To optimize meta tags, first you need to know what meta tags are present in the targeted web pages.

To do this, you can use Screaming Frog or other any software. But what if you haven’t this tool or you want to extract metadata of few selected URLs. On that time, you can use Google Sheets to extract page title and meta description of your targeted pages.

Follow below mentioned steps to extract meta tags from a website using Google Sheets:

  1. Create a new Google spreadsheet by entering sheets.new in the URL bar.
  2. After creating a spreadsheet, put down your URL list in a sheet, column A.
  3. Now enter the =IMPORTXML() formula in the second column.

    =IMPORTXML(URL of the page, xpath_query)
  4. This formula requires two parameters, the first is URL, from where you want to extract data. In the second parameter, you have to enter XPATH of your webpage element. For example, you can enter “//h1” to extract the H1 of your targeted page.

    =IMPORTXML("URL of the Page", "//h1")
  5. To extract page title of your targeted web page, enter this formula

    =IMPORTXML("URL","//title").

    Extract Page Title from a Website Using Google Sheets
  6. To extract meta description of your targeted web page, enter this formula

    =IMPORTXML("URL","//meta[@name=’description’]/@content").

    Extract Meta Description Using Google Sheets
  7. After entering this both formulas in B and C column, now you can drag it down to extract data of all URLs.

Now you understand how to extract meta tags, if you want to rewrite your meta tags and optimize for the SEO, you should use our meta description length checker that lets you check the character & pixel length of a page title & meta description. By using our tool, you can optimize your meta tags and get outstanding results in the SEO.

I hope you understand IMPORTXML formula, if you have any doubt, so you should check out this IMPORTXML formula guide.

You can also make a copy of Google Sheet by clicking on below button. In this sheet I have shared the examples.