SlideShare ist ein Scribd-Unternehmen logo
1 von 58
Downloaden Sie, um offline zu lesen
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

Weitere ähnliche Inhalte

Was ist angesagt?

Offline strategies for HTML5 web applications - IPC12
Offline strategies for HTML5 web applications - IPC12Offline strategies for HTML5 web applications - IPC12
Offline strategies for HTML5 web applications - IPC12
Stephan Hochdörfer
 
Leveraging the Power of Graph Databases in PHP
Leveraging the Power of Graph Databases in PHPLeveraging the Power of Graph Databases in PHP
Leveraging the Power of Graph Databases in PHP
Jeremy Kendall
 
WordPress Admin UI - Future Proofing Your Admin Pages
WordPress Admin UI - Future Proofing Your Admin PagesWordPress Admin UI - Future Proofing Your Admin Pages
WordPress Admin UI - Future Proofing Your Admin Pages
Brandon Dove
 
2012.sandiego.wordcamp
2012.sandiego.wordcamp2012.sandiego.wordcamp
2012.sandiego.wordcamp
Brandon Dove
 

Was ist angesagt? (20)

Hardcore URL Routing for WordPress - WordCamp Atlanta 2014
Hardcore URL Routing for WordPress - WordCamp Atlanta 2014Hardcore URL Routing for WordPress - WordCamp Atlanta 2014
Hardcore URL Routing for WordPress - WordCamp Atlanta 2014
 
SULTHAN's - PHP MySQL programs
SULTHAN's - PHP MySQL programsSULTHAN's - PHP MySQL programs
SULTHAN's - PHP MySQL programs
 
Offline strategies for HTML5 web applications - IPC12
Offline strategies for HTML5 web applications - IPC12Offline strategies for HTML5 web applications - IPC12
Offline strategies for HTML5 web applications - IPC12
 
PHP security audits
PHP security auditsPHP security audits
PHP security audits
 
Web Components and Modular CSS
Web Components and Modular CSSWeb Components and Modular CSS
Web Components and Modular CSS
 
Leveraging the Power of Graph Databases in PHP
Leveraging the Power of Graph Databases in PHPLeveraging the Power of Graph Databases in PHP
Leveraging the Power of Graph Databases in PHP
 
OOP Is More Than Cars and Dogs
OOP Is More Than Cars and DogsOOP Is More Than Cars and Dogs
OOP Is More Than Cars and Dogs
 
WordPress Admin UI - Future Proofing Your Admin Pages
WordPress Admin UI - Future Proofing Your Admin PagesWordPress Admin UI - Future Proofing Your Admin Pages
WordPress Admin UI - Future Proofing Your Admin Pages
 
Undercover Pods / WP Functions
Undercover Pods / WP FunctionsUndercover Pods / WP Functions
Undercover Pods / WP Functions
 
Concern of Web Application Security
Concern of Web Application SecurityConcern of Web Application Security
Concern of Web Application Security
 
Leveraging the Power of Graph Databases in PHP
Leveraging the Power of Graph Databases in PHPLeveraging the Power of Graph Databases in PHP
Leveraging the Power of Graph Databases in PHP
 
Php 102: Out with the Bad, In with the Good
Php 102: Out with the Bad, In with the GoodPhp 102: Out with the Bad, In with the Good
Php 102: Out with the Bad, In with the Good
 
Exploiting Php With Php
Exploiting Php With PhpExploiting Php With Php
Exploiting Php With Php
 
DBIx::Skinnyと仲間たち
DBIx::Skinnyと仲間たちDBIx::Skinnyと仲間たち
DBIx::Skinnyと仲間たち
 
Opening up the Social Web - Standards that are bridging the Islands
Opening up the Social Web - Standards that are bridging the IslandsOpening up the Social Web - Standards that are bridging the Islands
Opening up the Social Web - Standards that are bridging the Islands
 
Html5 and web technology update
Html5 and web technology updateHtml5 and web technology update
Html5 and web technology update
 
2012.sandiego.wordcamp
2012.sandiego.wordcamp2012.sandiego.wordcamp
2012.sandiego.wordcamp
 
http://kariwebsite.com/
http://kariwebsite.com/http://kariwebsite.com/
http://kariwebsite.com/
 
HTML::FormHandler
HTML::FormHandlerHTML::FormHandler
HTML::FormHandler
 
Date difference[1]
Date difference[1]Date difference[1]
Date difference[1]
 

Ähnlich wie SEO for Developers

TurboGears2 Pluggable Applications
TurboGears2 Pluggable ApplicationsTurboGears2 Pluggable Applications
TurboGears2 Pluggable Applications
Alessandro Molina
 
Jquery presentation
Jquery presentationJquery presentation
Jquery presentation
guest5d87aa6
 

Ähnlich wie SEO for Developers (20)

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

Kürzlich hochgeladen

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Kürzlich hochgeladen (20)

Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 

SEO for Developers