Ever wanted to find instances of a certain keyword on pages of a site that you can use as anchor text when creating more internal links? I did, when I was working on this website that sells curtain poles.
There’s a few ways of doing this, including a simple ‘site:’ search on Google, or using Screaming Frog’s search feature.
The Custom extraction method with Screaming Frog has a few benefits though:
– You can search for several phrases at once
– You can search only for occurrences of the keyword within <p> tags (to avoid returning occurrences that are already within links/nav menus/headings)
– You can include a column to show if there is already a link to the page that you’re trying to build internal links to
It’s pretty easy:
- In screaming frog, choose configuration > Custom > Extraction
- Setup your xpath extractors as per the screenshot below. (disregard the labels in the first column, I was lazy and forgot to change them from a previous search – you can name these whatever you want)
- Use the Xpath criteria below, entering your keywords and URLs of the page you’re trying to build links to.
//p[text()[contains(.,‘keyword or phrase’)]]
//p/a[@href[contains(.,’URL of page‘)]]
- Set the crawl to run. If you’re working on a large site, save time by changing the crawl settings to only crawl pages.
- Export the extraction. As shown in the screenshot below, the CSV includes the URL of the page in the first column, then each instance of the mention of the keyword in columns to the right of it. If the page has a link to the page defined in the extraction criteria, this will be included in the right hand column.
Got a question? Leave it in the comments below