angular and SEO

4,507 views
Skip to first unread message

christop...@gmail.com

unread,
Jun 19, 2012, 7:00:24 AM6/19/12
to ang...@googlegroups.com
Hi,

I am currently building a website which all pages are in hash bang and
the title/meta are using scope to change it, but viewing the code reveals
{{title}} though in the browser you can see the title.

Does this affect SEO at all? or it is just a bad idea?

I am no expert on SEO though im trying to learn it

thx and more power


Dan Doyon

unread,
Jun 19, 2012, 10:12:14 AM6/19/12
to ang...@googlegroups.com
Angular and seo are at odds, there are techniques that you use to deliver static pages to search engines

Angular is / and has been geared towards. Crud apps



Sent from my iPhone
--
You received this message because you are subscribed to the Google Groups "AngularJS" group.
To view this discussion on the web visit https://groups.google.com/d/msg/angular/-/lGSaMu-fJpsJ.
To post to this group, send email to ang...@googlegroups.com.
To unsubscribe from this group, send email to angular+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/angular?hl=en.

jeffau...@ymail.com

unread,
Jun 19, 2012, 10:16:48 AM6/19/12
to ang...@googlegroups.com
Yes, this affects SEO. The DOM is manipulated by Angular during page load, so search spiders will index the un-compiled content. Google is working on being able to parse javascript more intelligently in the future, but Angular is meant for web apps or parts of a page not intended to be indexed.

christop...@gmail.com

unread,
Jun 19, 2012, 10:38:10 AM6/19/12
to ang...@googlegroups.com
thx for the info

I just made this site to give angular a try, since I am liking it in the first couple of days now I end up using it in every part of the site @_@
I haven't find a way for php to read beyond #! in the url...




Noong Martes, Hunyo 19 2012 19:00:24 UTC+8, si christop...@gmail.com ay sumulat:

Igor Minar

unread,
Jun 19, 2012, 4:56:41 PM6/19/12
to ang...@googlegroups.com, bf...@google.com
using the html5 mode is definitely something I encourage.

In fact I asked Brian to change his angular-express-seed to use html5 mode by default: https://github.com/btford/angular-express-seed


- majority of apps suitable to be implemented in angular are not intended to be crawlable (internal apps, apps behind a login), so SEO is not a big deal there
- we are thinking of ways we could implement server-side pre-rendering. this is on our long-term roadmap and we are in fact doing some prototypes now, but I don't expect anything production ready any time soon
- we are hoping that the crawlers will get smarter and will be able to consume client-side apps

/i

On Tue, Jun 19, 2012 at 1:33 PM, Kyle Finley <kylef...@gmail.com> wrote:
Here's the strategy that I'm planning on implementing. I would love to get feedback on it.

My thoughts are that in the future I will be able to serve up Angular content to Google Bot either by parsing the javascript server-side or Google Bot will be smart enough to read javascript. Therefore, I would rather not have to maintain a bunch of #! url for the rest of my life, so I decided to just use absolute urls "/products" instead of "/#!/products" for example.

It turns out that Angular's html 5 Mode works perfectly with this strategy. If the browser supports html 5 location api it changes the url without a page refresh and if it doesn't it appends the hash ( #/products ).

On the server I have a catchall handler that catches all pages that aren't found and redirects them to their hash (#) equivalent. For example "/product" would be redirected to "/#/product". Since this is now loading the root page Angular will intercepts the request and rewrite it to "/product", but it will not reload the page. 

The downside is that there is an extra redirect when users visit pages other then the root, but I hope to remedy this in future. 

As for SEO I'm think the the catchall handler will inspect the headers. If if finds that a bot is making the request it will server static html, otherwise it will perform the redirect. This way Google Bot gets what it wants an I get to keep pretty urls.

Sorry for the long post. I would appreciate feedback on this strategy. I'm wondering if Google would penalize me for doing this, or if redirect would present any problems. 

- Kyle
--
You received this message because you are subscribed to the Google Groups "AngularJS" group.
To view this discussion on the web visit https://groups.google.com/d/msg/angular/-/wWQ-RUyHOogJ.

Lior Messinger

unread,
Apr 23, 2013, 5:37:20 PM4/23/13
to ang...@googlegroups.com, bf...@google.com
Igor, any chance of sharing some of the server-side rendering prototypes/branches? We are among those who are in need for an Angular SEO solution. BTW, AirBnB just open-sourced their server-side backbone.js Rendr

Christoph Burgdorf

unread,
Apr 30, 2013, 10:27:34 AM4/30/13
to ang...@googlegroups.com, christop...@gmail.com
I wrote a simple grunt task to make fetching html snapshots an easy build step

https://github.com/cburgdorf/grunt-html-snapshot
Reply all
Reply to author
Forward
0 new messages