SlideShare a Scribd company logo
re al
                                v
SEO For Developers
SELECT	
  *	
  WHERE	
  clue	
  >	
  0;

Date: February 29, 2012
Author: Chris Le (@djchrisle)




                                          1
$	
  whoami
     {	
  name:	
  	
  	
  	
  	
  	
  	
  	
  “Chris	
  Le”,
     	
  	
  twitter:	
  	
  	
  	
  	
  “@DjChrisLe”,

   	
  	
  occupation:	
  [
   	
  	
  	
  	
  “Internal	
  app	
  developer”,
   	
  	
  	
  	
  “Project	
  management”,
   	
  	
  	
  	
  “Technical	
  SEO	
  support”
   	
  	
  ]
   }
If you build it, they will come is a lie   3
re al
                                v
SEO For Developers
How SEO changed the way I develop


Date: February 29, 2012
Author: Chris Le (@djchrisle)




                                        4
5
@djchrisle   6
#	
  header.html.erb
<h1>&nbsp;</h1>
....

#	
  acme.css
h1	
  {	
  
	
  	
  background-­‐image:	
  ‘/img/acme_logo.png’;	
  
	
  	
  background-­‐repeat:	
  no-­‐repeat;
}




                                    @djchrisle             7
#	
  investments.html.erb
<a	
  href=”#watchlist”>
<div	
  id=”container”></div>
<script>
	
  	
  $(“#watchlist”).click	
  (function()	
  {
               //	
  =>	
  sets	
  loadThis	
  to	
  “watchlist”
	
  	
  	
  	
  var	
  loadThis	
  =	
  $.param.fragment($.param.querystring);
	
  	
  	
  	
  $(“#container”).load(“/content?get=”	
  +	
  loadThis);
	
  	
  }
</script>

#	
  content_controller.rb
class	
  ContentController	
  <	
  ActionController::Base
	
  	
  respond_to	
  :html

	
  	
  def	
  index
	
  	
  	
  	
  @content	
  =	
  Content.find_by_name(params[:get]
	
  	
  	
  	
  respond_with(@content)
	
  	
  end
end


                                     @djchrisle                                  8
http://www.acme.com/investments#positions
http://www.acme.com/investments#watchlist
http://www.acme.com/investments#menu1
http://www.acme.com/investments#menu2



                  @djchrisle                9
Best Practices

• Modularize & reuse code
 – DRY principals (Don’t Repeat Yourself)

• Abstract template and view from logic
 – Independently change stuff - no problems

• Use async JS loading to reduce load
 – Lower server costs
 – Fast load time (aka: “site speed”)


                         @djchrisle                     10
http://www.domain.com/about-­‐us/blog/post
http://www.domain.com/blog/post



                 @djchrisle                  11
Q: What is SEO?
 A: Help the RIGHT
customers find YOU.
                      12
About us




           13
@djchrisle   14
@djchrisle   15
@djchrisle   16
require	
  'anemone'

Anemone.crawl("http://www.example.com/")	
  do	
  |anemone|
	
  	
  anemone.on_every_page	
  do	
  |page|
	
  	
  	
  	
  	
  	
  puts	
  page.url
	
  	
  end
end

Bank.account	
  <<	
  Profit!




                                @djchrisle                17
@djchrisle   18
nsfw   19
Title tags


   @djchrisle   20
????




       21
#	
  header.html.erb
<title><%=	
  @company.name	
  %></title>




                               @djchrisle   22
#	
  header.html.erb
<title><%=	
  @company.name	
  %>	
  <%=	
  @page.title_tag	
  %></title>




                                  @djchrisle                                23
#	
  header.html.erb
<title><%=	
  @company.name	
  %>	
  <%=	
  @page.title_tag	
  %></title>

#	
  schema.rb
create_table	
  “Page”
	
  	
  t.string	
  “title_tag”
	
  	
  ...
end

#	
  page.rb
Class	
  Page	
  <	
  ActiveRecord::Base
	
  	
  belongs_to	
  :category
	
  	
  
	
  	
  def	
  title_tag
	
  	
  	
  	
  title_tag.defined?	
  ?	
  super()	
  :	
  self.category.name
	
  	
  end
end



                                       @djchrisle                               24
puts	
  Page.find(1).inspect

{
	
  	
  title_tag:	
  “Experienced	
  Ruby	
  Programmers	
  in	
  Philladelphia”,
	
  	
  content:	
  “...”
}




                                    @djchrisle                                   25
Title matches
                                                 keyword
                                                 + is what user
                                                 is looking for

My Company | Experienced Ruby Programmers in Philadelphia




                                                             26
<h1> tags


   @djchrisle   27
#	
  post/index.html.erb
<h1><%=	
  @post.title	
  %></h1>




              @djchrisle            28
@djchrisle   29
@djchrisle   30
#	
  my_page.html.erb
<h1>&nbsp;</h1>
....

#	
  acme.css
h1	
  {	
  
	
  	
  background-­‐image:	
  ‘/img/acme_logo.png’;	
  
	
  	
  background-­‐repeat:	
  no-­‐repeat;
}




                                    @djchrisle             31
This page is about
                                       “Non-breaking space?”
#	
  my_page.html.erb
<h1>&nbsp;</h1>
....

#	
  acme.css
h1	
  {	
  
	
  	
  background-­‐image:	
  ‘/img/acme_logo.png’;	
  
	
  	
  background-­‐repeat:	
  no-­‐repeat;
}




                                    @djchrisle             32
Better use of H1
#	
  my_page.html.erb
<div	
  class=”logo”></div>
<h1>	
  Sensible	
  Investment	
  Strategies	
  </h1>
....

#	
  acme.css
.logo	
  {	
  
	
  	
  background-­‐image:	
  ‘/img/acme_logo.png’;	
  
	
  	
  background-­‐repeat:	
  no-­‐repeat;
}




                                    @djchrisle                  33
URLs &
Hash fragments

      @djchrisle   34
http://www.acme.com/investments#positions
http://www.acme.com/investments#watchlist
http://www.acme.com/investments#menu1
http://www.acme.com/investments#menu2



                  @djchrisle                35
http://www.acme.com/investments#positions
    http://www.acme.com/investments#watchlist
    http://www.acme.com/investments#menu1
    http://www.acme.com/investments#menu2
                                  4 pages .. 1 listing :(



Acme Inc | Financial Portfolio Managers
www.acme.com/investments




                             @djchrisle                     36
Uncrawlable URL
#	
  investments.html.erb

<a	
  href=”#watchlist”>

<div	
  id=”container”></div>

<script>
	
  	
  $(“#watchlist”).click	
  (function()	
  {
               //	
  =>	
  sets	
  loadThis	
  to	
  “watchlist”
	
  	
  	
  	
  var	
  loadThis	
  =	
  $.param.fragment($.param.querystring);
	
  	
  	
  	
  $(“#container”).load(“/content?get=”	
  +	
  loadThis);
	
  	
  }
</script>




                                                                                 37
Crawlable URL
#	
  investments.html.erb

<a	
  href=”/investments/watchlist”>

<div	
  id=”container”></div>

<script>
	
  	
  $(“#watchlist”).click	
  (function()	
  {
	
  	
  	
  	
  $(“#container”).load($.param.querystring);
	
  	
  }
</script>




                                                             38
#	
  routes.rb
resources	
  :investments
match	
  “content/:section”	
  =>	
  “content#show”

#	
  content_controller.rb
class	
  ContentController	
  <	
  ActionController::Base
	
  	
  respond_to	
  :html

	
  	
  def	
  show
	
  	
  	
  	
  @content	
  =	
  Content.find_by_name(params[:section])
	
  	
  	
  	
  respond_with(@content)
	
  	
  end
end




                                   @djchrisle                             39
http://www.acme.com/investments/positions
    http://www.acme.com/investments/watchlist
    http://www.acme.com/investments/menu1
    http://www.acme.com/investments/menu2
                                  4 pages .. 4 listings :)



Acme Inc | Financial Portfolio Managers
www.acme.com/investments/positions




                             @djchrisle                      40
301 / 302
 redirect

   @djchrisle   41
http://www.domain.com/about-­‐us/blog/post
http://www.domain.com/blog/post



                 @djchrisle                  42
#	
  content_controller.rb
class	
  ContentController	
  <	
  ActionController::Base
	
  	
  respond_to	
  :html

	
  	
  def	
  show
	
  	
  	
  	
  redirect_to	
  :post_path
	
  	
  	
  	
  #	
  @content	
  =	
  Content.find_by_id(params[:id])
	
  	
  	
  	
  #	
  respond_with(@content)
	
  	
  end
end




                                      @djchrisle                        43
Defaults as 302 response

#	
  content_controller.rb
class	
  ContentController	
  <	
  ActionController::Base
	
  	
  respond_to	
  :html

	
  	
  def	
  show
	
  	
  	
  	
  redirect_to	
  :post_path
	
  	
  	
  	
  #	
  @content	
  =	
  Content.find_by_id(params[:id])
	
  	
  	
  	
  #	
  respond_with(@content)
	
  	
  end
end




                                      @djchrisle                        44
301 vs 302 redirect


• RFC 2616, Section 10.3.3
 – 302 Found: The requested resource resides
  temporarily under a different URI


• RFC 2616, Section 10.3.2
 –301 Moved Permanently: The requested resource has
  been assigned a new permanent URI and any future
  references to this resource SHOULD use one of the
  returned URIs


                       @djchrisle                    45
46
302 =
nothing




          47
301 =
change




         48
404 = delist




          49
#	
  content_controller.rb
class	
  ContentController	
  <	
  ActionController::Base
	
  	
  respond_to	
  :html

	
  	
  def	
  show
	
  	
  	
  	
  redirect_to	
  :post_path,	
  :status	
  =>	
  301
	
  	
  	
  	
  #	
  @content	
  =	
  Content.find_by_id(params[:id])
	
  	
  	
  	
  #	
  respond_with(@content)
	
  	
  end
end




                                @djchrisle                              50
#	
  content_controller.rb
class	
  ContentController	
  <	
  ActionController::Base
	
  	
  respond_to	
  :html

	
  	
  def	
  show
	
  	
  	
  	
  redirect_to	
  :post_path,	
  :status	
  =>	
  301
	
  	
  	
  	
  #	
  @content	
  =	
  Content.find_by_id(params[:id])
	
  	
  	
  	
  #	
  respond_with(@content)
	
  	
  end
end




                                @djchrisle                              51
#	
  routes.rb

match	
  “/about-­‐us/blog/:post_title”	
  =>	
  
	
  	
  redirect(“/blog/#{params[:post_title]}”)




                                                    52
If you build it, they will come is a lie   53
Every great idea
   deserves the
chance to be found

       @djchrisle    54
re al
                                v
SEO For Developers
How SEO changed the way I develop


Date: February 29, 2012
Author: Chris Le (@djchrisle)




                                        55
Q&A


@djchrisle   56
2006-2007




            57
58

More Related Content

PDF
CSSプリプロセッサの取扱説明書
PPTX
Introduction to CodeIgniter (RefreshAugusta, 20 May 2009)
KEY
HTML 5 & CSS 3
PDF
Ams adapters
PPT
Hardcore URL Routing for WordPress - WordCamp Atlanta 2014 (PPT)
PPTX
Let's write secure Drupal code! - Drupal Camp Poland 2019
PDF
OSDC 2009 Rails Turtorial
PDF
Hardcore URL Routing for WordPress - WordCamp Atlanta 2014
CSSプリプロセッサの取扱説明書
Introduction to CodeIgniter (RefreshAugusta, 20 May 2009)
HTML 5 & CSS 3
Ams adapters
Hardcore URL Routing for WordPress - WordCamp Atlanta 2014 (PPT)
Let's write secure Drupal code! - Drupal Camp Poland 2019
OSDC 2009 Rails Turtorial
Hardcore URL Routing for WordPress - WordCamp Atlanta 2014

What's hot (19)

PDF
SULTHAN's - PHP MySQL programs
PDF
Offline strategies for HTML5 web applications - IPC12
KEY
PHP security audits
PDF
Web Components and Modular CSS
PDF
Leveraging the Power of Graph Databases in PHP
PDF
OOP Is More Than Cars and Dogs
PDF
WordPress Admin UI - Future Proofing Your Admin Pages
PDF
Undercover Pods / WP Functions
ODP
Concern of Web Application Security
PDF
Leveraging the Power of Graph Databases in PHP
ODP
Php 102: Out with the Bad, In with the Good
PPT
Exploiting Php With Php
KEY
DBIx::Skinnyと仲間たち
PDF
Opening up the Social Web - Standards that are bridging the Islands
PPTX
Html5 and web technology update
PDF
2012.sandiego.wordcamp
TXT
http://kariwebsite.com/
ODP
HTML::FormHandler
TXT
Date difference[1]
SULTHAN's - PHP MySQL programs
Offline strategies for HTML5 web applications - IPC12
PHP security audits
Web Components and Modular CSS
Leveraging the Power of Graph Databases in PHP
OOP Is More Than Cars and Dogs
WordPress Admin UI - Future Proofing Your Admin Pages
Undercover Pods / WP Functions
Concern of Web Application Security
Leveraging the Power of Graph Databases in PHP
Php 102: Out with the Bad, In with the Good
Exploiting Php With Php
DBIx::Skinnyと仲間たち
Opening up the Social Web - Standards that are bridging the Islands
Html5 and web technology update
2012.sandiego.wordcamp
http://kariwebsite.com/
HTML::FormHandler
Date difference[1]
Ad

Similar to SEO for Developers (20)

PPTX
Diazo: Bridging Designers and Programmers
PDF
Migration Best-Practices: Successfully re-launching your website - SMX New Yo...
PPTX
Jquery tutorial
PDF
Advanced CSS Troubleshooting & Efficiency
KEY
Introduction Django
PPTX
Oracle Application Express & jQuery Mobile - OGh Apex Dag 2012
PDF
TurboGears2 Pluggable Applications
PDF
Haml. New HTML? (RU)
KEY
Theming websites effortlessly with Deliverance (CMSExpo 2010)
PDF
Advanced CSS Troubleshooting
PDF
Um roadmap do Framework Ruby on Rails, do Rails 1 ao Rails 4 - DevDay 2013
PDF
Grok Drupal (7) Theming - 2011 Feb update
PDF
Choosing a Javascript Framework
DOCX
Controller in AngularJS
PDF
Introduction to Django
PDF
Scaling Complexity in WordPress Enterprise Apps
PPTX
JavaScript front end performance optimizations
PPT
Jquery presentation
PDF
Presentation html5 css3 by thibaut
PPTX
BrightonSEO Structured Data by Alexis Sanders
Diazo: Bridging Designers and Programmers
Migration Best-Practices: Successfully re-launching your website - SMX New Yo...
Jquery tutorial
Advanced CSS Troubleshooting & Efficiency
Introduction Django
Oracle Application Express & jQuery Mobile - OGh Apex Dag 2012
TurboGears2 Pluggable Applications
Haml. New HTML? (RU)
Theming websites effortlessly with Deliverance (CMSExpo 2010)
Advanced CSS Troubleshooting
Um roadmap do Framework Ruby on Rails, do Rails 1 ao Rails 4 - DevDay 2013
Grok Drupal (7) Theming - 2011 Feb update
Choosing a Javascript Framework
Controller in AngularJS
Introduction to Django
Scaling Complexity in WordPress Enterprise Apps
JavaScript front end performance optimizations
Jquery presentation
Presentation html5 css3 by thibaut
BrightonSEO Structured Data by Alexis Sanders
Ad

Recently uploaded (20)

PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
Assigned Numbers - 2025 - Bluetooth® Document
PDF
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
PPTX
A Presentation on Touch Screen Technology
PDF
DASA ADMISSION 2024_FirstRound_FirstRank_LastRank.pdf
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
WOOl fibre morphology and structure.pdf for textiles
PDF
project resource management chapter-09.pdf
PDF
Approach and Philosophy of On baking technology
PPTX
Tartificialntelligence_presentation.pptx
PPTX
SOPHOS-XG Firewall Administrator PPT.pptx
PDF
gpt5_lecture_notes_comprehensive_20250812015547.pdf
PPTX
Chapter 5: Probability Theory and Statistics
PPTX
cloud_computing_Infrastucture_as_cloud_p
PDF
Hindi spoken digit analysis for native and non-native speakers
PDF
DP Operators-handbook-extract for the Mautical Institute
PPTX
TechTalks-8-2019-Service-Management-ITIL-Refresh-ITIL-4-Framework-Supports-Ou...
PPTX
TLE Review Electricity (Electricity).pptx
PPTX
A Presentation on Artificial Intelligence
PDF
Microsoft Solutions Partner Drive Digital Transformation with D365.pdf
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Assigned Numbers - 2025 - Bluetooth® Document
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
A Presentation on Touch Screen Technology
DASA ADMISSION 2024_FirstRound_FirstRank_LastRank.pdf
Unlocking AI with Model Context Protocol (MCP)
WOOl fibre morphology and structure.pdf for textiles
project resource management chapter-09.pdf
Approach and Philosophy of On baking technology
Tartificialntelligence_presentation.pptx
SOPHOS-XG Firewall Administrator PPT.pptx
gpt5_lecture_notes_comprehensive_20250812015547.pdf
Chapter 5: Probability Theory and Statistics
cloud_computing_Infrastucture_as_cloud_p
Hindi spoken digit analysis for native and non-native speakers
DP Operators-handbook-extract for the Mautical Institute
TechTalks-8-2019-Service-Management-ITIL-Refresh-ITIL-4-Framework-Supports-Ou...
TLE Review Electricity (Electricity).pptx
A Presentation on Artificial Intelligence
Microsoft Solutions Partner Drive Digital Transformation with D365.pdf

SEO for Developers