Search Knowledgebase:![]() |
Alert if a certain tag is missing in the page source
User question:
> How to check a web page for the absence of a particular meta tag?
> If it's missing, alert me.
> Concretely, if this tag is missing, I would like to know about it:
> <META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
This is possible via a plugin.
The following plugin only checks the availability of that tag and does not monitor changes in the page content. So you will only get a notification if this tag is missing.
Sub Wsw_BeforeCheck(Handle)
'Disable optimizations and always check this bookmark by content
Bookmark_SetProperty(Handle, "checkmethod", "content")
End Sub
Sub Wsw_CompareVersions(Handle, ByRef sMemWeb, ByRef sMemLocal, ByRef sStatusMessage, ByRef iStatusCode)
'default value of iStatusCode is 0 (=no update)
Dim bFound = InStr(UCase(sMemWeb), "<META NAME=""ROBOTS"" CONTENT=""NOINDEX, NOFOLLOW"">") > 0
If bFound = False Then
'Tag not found -> alert update
iStatusCode = 1
sStatusMessage = "TAG not found"
End If
End Sub