useful SEO XPath's & CSS selectors X
⚠️ THIS IS A WORK IN PROGRESS
1
2
xpaths <- c("//meta[@name='viewport']/@content",
3
"//meta[@charset]/@charset",
4
"//link[@rel='canonical']/@href",
5
"//link[@rel='alternate']/@href",
6
"//link[@rel='alternate']/@hreflang",
7
"//meta[starts-with(@property, 'og:')]/@property",
8
"//meta[starts-with(@property, 'og:')]/@content",
9
"//meta[starts-with(@name, 'twitter:')]/@name",
10
"//meta[starts-with(@name, 'twitter:')]/@content",
11
"//iframe/@src",
12
"//script[contains(@src, 'googletagmanager.com/gtm.js?id=')]/@src",
13
"//iframe[contains(@src, 'googletagmanager.com/ns.html?id=')]/@src",
14
"//link[@rel]/@rel",
15
"//link[@rel]/@href",
16
"//link[@rel='stylesheet']/@href",
17
"//link[contains(@href, '.css')]/@href",
18
"//footer//a/text()",
19
"//footer//a/@href",
20
"//header//a/text()",
21
"//header//a/@href",
22
"//script[@type='text/javascript']/@src",
23
"//script[@type='text/javascript']/text()",
24
"//script//@src",
25
"name(//link[@rel='canonical']/..)")
26
27
28
29
names <- c("viewport",
30
"charset",
31
"canonical",
32
"alt_href",
33
"alt_hreflang",
34
"og_props",
35
"og_content",
36
"twtr_names",
37
"twtr_content",
38
"iframe_src",
39
"gtm_script",
40
"gtm_noscript",
41
"link_rel_rel",
42
"link_rel_href",
43
"link_rel_stylesheet",
44
"css_links",
45
"footer_links_text",
46
"footer_links_href",
47
"header_links_text",
48
"header_links_href",
49
"js_script_src",
50
"js_script_text",
51
"script_src",
52
"canonical_parent")
53
Copied!
Value
xpath
CSS
canonical tag
//link[@rel='canonical']/@href
head > link[rel="canonical"]
Page Title
//title
head > title
Meta Description
//meta[@name='description']/@content
head > meta[name="description"]
Last modified 8mo ago
Copy link