drupal 7 search engine optimisation
TRANSCRIPT
DRUPAL 7 SEOHow to structure a Drupal website for strategic Search Engine
Optimisation
Peter Macinkovic | @inkovic on Twitter
Drupal Melbourne Meetup | July 2016
WHAT MAKES SEO IN DRUPAL DIFFERENT?
Drupal is Flexible: You are not ‘locked in’ any particular information architecture
Out of the Box, Drupal 7 is lacking: There are a few ‘must-have’ modules for most Drupal installations
Drupal is Creative: You can solve a lot of common SEO problems in a couple of different ways
ENABLING CLEANS URLINDEXING AND CRAWLABILITY
• By default, URLs are querieseg: http://www.example.com/?q=node/83
• Clean URLs helps Google Spiders crawl your URLs more cleanly than queries
Source: http://drupal.stackexchange.com/a/54570/21701
Reference: https://www.drupal.org/getting-started/clean-urls
• Required: mod_rewrite enabled in Apache• For nginx and other platforms, refer to
https://www.drupal.org/node/717772
ENABLING CLEANS URLINDEXING AND CRAWLABILITY
URL: example.com/admin/config/search/clean-urlsURL: example.com/admin/config/search
MANAGING URL ALIASESINDEXING AND CRAWLABILITY
• By default, each node has a hard referenced system URLeg: /node/12
• URLs can be Aliased to match a node for a semantically correct url
• Path, the default module is limited• Pathauto makes URL configuration easy
Source: http://example.com/admin/config/search/path
Reference: https://www.drupal.org/project/pathauto
MANAGING URL ALIASES: PATHAUTOINDEXING AND CRAWLABILITY
• Using Tokens to create semantic URL structureseg: /articles/[node:title]
• Parent would likely be a View• eg: /articles could be a views page
that lists all articles in order of publish date
Source: http://example.com/admin/config/search/path/patterns
drupal.org/project/clean_markup
GLOBAL REDIRECT
drupal.org/project/clean_markup
CURING ‘DIVITIS’ IN DRUPAL
• Default markup rendered is lousy: Drupal 7 has a nasty habit of wrapping everything in 2+ divs and slapping on 3+ classes on everything
• Blocks by default render the block title as a h2: Hierarchy of heading tags in HTML is really important for SEO. Unchanged Blocks divert attention from the content of the page.
• Modular solution or Theme level: Pick the appropriate solution, whether it is overwriting a tpl.php file or using a module to change defaults.
• Compatible with Display Suite: Configuring a bundle is almost identical to configuring the fields of a content type.
MANAGING HTML OUTPUTCLEAN BLOCKS MODULE
• Clean Markup: Choose the wrapper elements of HTML for Panels, Blocks etc.
• Useful for sitebuilders to control output
• Removes the need to customise at the theme levelReference: https://www.drupal.org/project/clean_markup
MANAGING HTML OUTPUTCLEAN BLOCKS MODULE
• Clean Markup: Choose the wrapper elements of HTML for Panels, Blocks etc.
• Useful for sitebuilders to control output
• Removes the need to customise at the theme levelReference: https://www.drupal.org/project/clean_markup
drupal.org/project/clean_markup
MANAGING HTML OUTPUTOTHER TIPS
• Theme Each Content Type Optimally: Try to render fields that are semantic and schema.org compliant. Do not leave this to the content author.
• Theme Common Elements: Default blocks template, views templates etc.
• Make sure it is fast: Cached everything for anonymous users. Use Boost, Varnish, Aggregation on Javascript and CSS.
MANAGING METATAGSMETATAG MODULE
• Meta Tags are important: Page Title and the first h1 tags are considered the most important onsite elements for keywords
• Smart Defaults: Using tokens and pattern matching to create verbose
• Customise on a Entity-by-Entity Basis
Reference: https://www.drupal.org/project/metatag
• Alternative: metatag_quick, page_title
drupal.org/project/metatag
MANAGING METATAGSCONFIGURING DEFAULT METATAGS
• Configure Smart Defaults: By default, all 404 pages have their canonical URL set to root URL
• Configure Your Nodes: Make sure that you have verbose defaults for Page Title, Description etc.
• Contextual Awareness: Do edge case exceptions. i.e. if term reference or view page = 0 results, reference parent.
• 1 result? Canonical the result itself!
MANAGING VIEWSCONFIGURING DEFAULT VIEWS PAGES
• Configure Individual Views Pages: Ensure correct Metatags are set via Views Metatag Overview.
drupal.org/project/metatag_views_overview
• Pagination: Ensure <link rel=“previous” href=“/1”> etc. are configured to improve crawlability of View Pages
Refer to: https://www.drupal.org/node/1567684
drupal.org/project/views_rss
MANAGING VIEWSCONFIGURING REL ALTERNATIVE FEEDS
• Set rel alternative to a feed:
Create an RSS feed for all Views/List pages with an RSS version to improve indexability of nodes.
drupal.org/project/path_breadcrumbs
MANAGING BREADCRUMBSCONFIGURING RICH SNIPPET
• All Else Fails, Use JSON-LD + Contextual Views: Quick. Dirty. JSON in between a script tag.
• Do NOT Use Microdata: BreadcrumbList is buggy. Use JSON-LD or RDFa vocab instead.
Don’t forget View Pages: Breadcrumsb aren’t just for nodes.
Reference: https://www. schema.org/BreadcrumbList
drupal.org/project/path_breadcrumbs
QUESTIONS?
• I didn’t cover Context in this talk: Strategic Block Placement on a /path level can be used strategically to hyper optimise a page like taxonmy or views pages.
• I don’t like the SEO Checklist module: It’s opinionated and so am I.