Extract MULTIPLE titles with this Google Sheets function
This is a more of a personal bookmark than a whole article, but I assume it might help someone, somewhere :)
This little nifty snippet uses the default =IMPORTXML function of a given url (in my sheet, that URL is in cell A1), and then shows it if a page has MULTIPLE title tags (you can also use it for other checks, like duplicate canonicals, descriptions, etc.).
You'd be surprised how many times that happens.
=IF(COUNTA(IMPORTXML(A2, "//title"))>1, "Multiple Titles Found: " & char(10) & TEXTJOIN(CHAR(10), TRUE, IMPORTXML(A2, "//title")), IMPORTXML(A2, "//title"))So the next time you use =IMPORTXML to return the title of a given url, please use this snippet, because you might just miss something important.