Upgrade Your Drupal Skills

We trained 1,000+ Drupal Developers over the last decade.

See Advanced Courses NAH, I know Enough

Keeping track of backlinks in Drupal 7

Parent Feed: 

A popular feature request for sites that deal with a lot of content, is to see for each page what other pages are linking back to it. This can be helpful when doing some SEO or cleaning up and rewriting old content.

In Drupal 7 this is easily done. It exists where you wouldn't immediately expect it though: the core search module. Kind of mimicking how search bots like Google's indexer works, Drupal 7's search module now takes the amount of nodes linking back to another node to calculate the score for some result.

To keep track of which nodes (and other) link to which other ones, the search indexer stores all links in a table called search_node_links. This table is only used internally by the search module though, but if you enable the Views module, you can enable a default view called "Backlinks".

The Backlinks view has 2 displays: a block and a page. The block you can put wherever you want, the page is added as an extra tab on each node next to "view" and "edit".

You can also choose to create your own views using the "Search: Links to" and "Search: Links from" argument and filter.

Let me finish this quick tip by mentioning that this feature works fine with url aliases too.

backlinks.png

Note: It appears this was already possible in Drupal 6. Check out the update.

Original Post: 

About Drupal Sun

Drupal Sun is an Evolving Web project. It allows you to:

  • Do full-text search on all the articles in Drupal Planet (thanks to Apache Solr)
  • Facet based on tags, author, or feed
  • Flip through articles quickly (with j/k or arrow keys) to find what you're interested in
  • View the entire article text inline, or in the context of the site where it was created

See the blog post at Evolving Web

Evolving Web