web2py and SEO

348 views
Skip to first unread message

puercoespin

unread,
Aug 6, 2010, 7:13:13 AM8/6/10
to web2py-users
Is web2py designed for a good practices about SEO? Are some frameworks
SEO-friends and others no SEO-friends and, if this is true, are web2py
SEO-friend?

Thanks

mdipierro

unread,
Aug 6, 2010, 7:24:42 AM8/6/10
to web2py-users
web2py does not care. I do not think there is any difference between
frameworks about this. The issue how you use them.

web2py provides response.meta that combined with the default layout
allows you to set

response.meta.keywords
response.meta.description
response.meta.author

If you have recommendations about specific features that need to be
implemented at the framework level, let us know.






On Aug 6, 6:13 am, puercoespin <jzaragoza.puercoes...@gmail.com>
wrote:

Bruno Rocha

unread,
Aug 6, 2010, 9:13:58 AM8/6/10
to web...@googlegroups.com
SEO is basically done through:

page title (response.meta.title)
page keywords ( response.meta.keywords)
page description ( response.meta.description)

plus: 
the robots.txt file under website root directory, 
good practices for creating links and inserting images, 
Semantic html markup ( I mean always including "name" , "alt", "title" for relevant tags), 
and also using correctly the most relevant tags (h1,h2,h..., <em>, <strong> etc )

And one of the most important thing: Build a sitemap [1]

web2py is ready to do all that, but we need to do it all from the scratch, what we need now is a helper or a mechanism to make it more user friendly.As is done by the plugin ALL-IN-ONE-PACK-SEO on wordpress for example.






2010/8/6 mdipierro <mdip...@cs.depaul.edu>

Bruno Rocha

unread,
Aug 6, 2010, 9:33:05 AM8/6/10
to web...@googlegroups.com
I believe that a simple helper, to be called in any view or controller is enought, imagine:

view:
{{extend 'layout.html'}}
{{SEO(title='My Product view',
     keywords='phones,calls,smartphone',
     description='This is a phone seller site made with web2py',
     author='me',
     sitemap=['/products/categories/phones']
}}
<h1 id="">Choose your phone</h1>
...
...
...

Another important thing is the page slug, even if the action is called e.g: "showproduct" and that expect an product id for a product named "XPTO smartphone", then
"/showprodict/id" needs to be accessible by "/showproduct/xpto-smartphone" 
but it is a database design matter, I dont know how web2py could help with that.
video about SEO:
http://www.mahalo.com/how-to-seo-your-website


2010/8/6 Bruno Rocha <rocha...@gmail.com>

Bruno Rocha

unread,
Aug 6, 2010, 9:40:32 AM8/6/10
to web...@googlegroups.com

List of Best and Worst practices:



2010/8/6 Bruno Rocha <rocha...@gmail.com>

mdipierro

unread,
Aug 6, 2010, 9:50:01 AM8/6/10
to web2py-users
You should this in a model, before the view is executed:

response.title='My Product view'
response.meta.keywords='phones,calls,smartphone'
response.meta.description='This is a phone seller site made with
web2py'
response.meta.author='me'

The sitemap cannot be accomplished by a helper. It needs a helper and
a storage.



On Aug 6, 8:33 am, Bruno Rocha <rochacbr...@gmail.com> wrote:
> I believe that a simple helper, to be called in any view or controller is
> enought, imagine:
>
> view:
>
> {{extend 'layout.html'}}
>
> {{SEO(title='My Product view',
>
>      keywords='phones,calls,smartphone',
>
>      description='This is a phone seller site made with web2py',
>
>      author='me',
>
>      sitemap=['/products/categories/phones']
>
> }}
>
> <h1 id="">Choose your phone</h1>
> ...
>
> ...
>
> ...
>
> Another important thing is the page slug, even if the action is called
> e.g: "showproduct" and that expect an product id for a product named
> "XPTO smartphone", then
> "/showprodict/id" needs to be accessible by "/showproduct/xpto-smartphone"
> but it is a database design matter, I dont know how web2py could help with that.
>
> video about SEO:http://www.mahalo.com/how-to-seo-your-website
>
> 2010/8/6 Bruno Rocha <rochacbr...@gmail.com>
>
>
>
> > SEO is basically done through:
>
> > page title (response.meta.title)
> > page keywords ( response.meta.keywords)
> > page description ( response.meta.description)
>
> > plus:
> > the robots.txt file under website root directory,
> > good practices for creating links and inserting images,
> > Semantic html markup ( I mean always including "name" , "alt", "title" for
> > relevant tags),
> > and also using correctly the most relevant tags (h1,h2,h..., <em>, <strong>
> > etc )
>
> > And one of the most important thing: Build a sitemap [1]
>
> > web2py is ready to do all that, but we need to do it all from the scratch,
> > what we need now is a helper or a mechanism to make it more user friendly.As
> > is done by the plugin ALL-IN-ONE-PACK-SEO on wordpress for example.
>
> > [1]http://en.wikipedia.org/wiki/Site_map
>
> > 2010/8/6 mdipierro <mdipie...@cs.depaul.edu>

Bruno Rocha

unread,
Aug 6, 2010, 10:04:44 AM8/6/10
to web...@googlegroups.com
2010/8/6 mdipierro <mdip...@cs.depaul.edu>
You should this in a model, before the view is executed:

response.title='My Product view'
response.meta.keywords='phones,calls,smartphone'
response.meta.description='This is a phone seller site made with
web2py'
response.meta.author='me'

The sitemap cannot be accomplished by a helper. It needs a helper and
a storage.

In this example you are declaring globally.
The problem is that SEO variables. must be unique for each view, and sometimes, must be built according to the parameters received, as in the example of Canonical URLS.

take this example:
/ Showproduct/01 the url needs to be changed to /showproduct/foo-smartphone

and also title of the page needs to be amended in accordance with the product,
response.title = "my phone shop | phones | Smartphone foo"
response.keywords = "foo, phone, brand, 3G, 5 mp cam"

Regarding the sitemap is a good point to look how this is being done out there, to get an idea:
 

mdipierro

unread,
Aug 6, 2010, 10:50:42 AM8/6/10
to web2py-users
They can be even if you define them in a model but ok, you can define
them in a view but must come before the extend.

{{
response.title='My Product view'
response.meta.keywords='phones,calls,smartphone'
response.meta.description='This is a phone seller site made with
web2py'
response.meta.author='me'
}}

{{extend 'layout.html'}}
....

On Aug 6, 9:04 am, Bruno Rocha <rochacbr...@gmail.com> wrote:
> 2010/8/6 mdipierro <mdipie...@cs.depaul.edu>
> COOL FEATUREhttp://docs.djangoproject.com/en/dev/ref/contrib/sitemaps/?from=olddo...http://code.google.com/p/django-seo-tools/
>
>

puercoespin

unread,
Aug 11, 2010, 5:52:24 PM8/11/10
to web2py-users
As Bruno Rocha points, a sitemap is very, very importan for SEO. And
other frameworks are adding tools for generating those sitemaps, for
example, Django.

""""
The sitemap framework¶
Django comes with a high-level sitemap-generating framework that makes
creating sitemap XML files easy.

""""
extracted from the link

http://docs.djangoproject.com/en/dev/ref/contrib/sitemaps/

IMHO, web2py needs for a similar tools, for generating sitemaps.

Thanks.

mdipierro

unread,
Aug 11, 2010, 6:19:08 PM8/11/10
to web2py-users
No objection but I think this belongs to a plugin.

On Aug 11, 4:52 pm, puercoespin <jzaragoza.puercoes...@gmail.com>
wrote:

mdipierro

unread,
Aug 11, 2010, 6:23:15 PM8/11/10
to web2py-users
Could you provide a list of features you would like to see?

Massimo

On Aug 11, 4:52 pm, puercoespin <jzaragoza.puercoes...@gmail.com>
wrote:

mdmcginn

unread,
Aug 12, 2010, 1:04:54 PM8/12/10
to web2py-users
Many famous SEO ranking factors, such as meta-keywords, are no longer
very important. Site architecture and URL structure (permalinks, for
example) have importance. Sitemaps, especially for huge sites, have
minimal importance. You're okay as long as Google can figure out how
to crawl your whole site. Here's a fairly authoritative list of
ranking factors:
http://www.seomoz.org/article/search-ranking-factors#ranking-factors

web2py seems to have the potential for excellent URL structure (if you
change "/default/" to one of your targeted keywords) and meta-tags are
easy to use.

--
Michael McGinnis

On Aug 11, 4:52 pm, puercoespin <jzaragoza.puercoes...@gmail.com>
wrote:

puercoespin

unread,
Aug 22, 2010, 8:53:22 AM8/22/10
to web2py-users


On 12 ago, 00:23, mdipierro <mdipie...@cs.depaul.edu> wrote:
> Could you provide a list of features you would like to see?
>
> Massimo
>
> On Aug 11, 4:52 pm, puercoespin <jzaragoza.puercoes...@gmail.com>
> wrote:
>
>

First of all, I want to indicate that I am not an expert in SEO, not
in Python not in Web2py. In fact, I am not expert in anything :)

I think that a good beginning to create a list of possible features
that, in my opinion, it should have Web2py in reference to SEO, would
be the Google’s doc " Google's Search Engine Optimization. Starter
Guide ", and it can be found in " http: //
www.google.com/webmasters/docs/search-engine-optimization-starter-guide.pdf
". It is a brief document, of only 22 pages, but very interesting and
whose reading I recommend. In addition, it has links to go deeper into
some treated topics, as well as to tools for webmaster related to SEO.

What I am going to expose is a small summary of the document, as a
list, of the elements that a web site must have in order that it could
obtain a good positioning. I think that in some of them, web2py might
facilitate the fulfilment of these elements.

1.- "Create unique, accurate page titles", "Create unique title tags
for each page", "Make use of the 'description' meta tag", "Use unique
descriptions for each page", "Improve the structure of your URLs".

When Google presents us a list of webs as result of a search, he
presents first the title of the web, a small text, which can - or not
- match with the text of the meta tag "description", and a url link to
the web. So is very important put the major care in refilling this
meta tags. So I think that Web2py must to ask for title and
description when created a new application. In order that every page
has a title and a different description, depending on his content,
maybe doing that the controller returning variables title and
description??

URL’s must included words that can be found in a user search. And
reflected the web’s structure, if possible, clean and ordered. Also,
if a user “cuts” some parts of a url, (www.exemple.com/an/url/very/
large/ and user cuts /large, for example) the reply not would be an
stranger message. About url’s, I think web2py does a good job.

2.- "Make your site easier to navigate"

Everything related to the user ease of navigation will be appreciated
by the search engines. In fact, in SEO, accessibility and usability
counts. So it's recommended a sitemap (lower case), that is a html
file, generally located in the root, and with a hierarchy links of the
pages of the site, maybe with its title and description. This file is
aimed to human visitors.

Also, it's recommended a Sitemap (upper case), That’s a xml file,
aimed to search engines. With this file, the webmaster can inform to
search engines about the frequency of changes of the web, or what are
the most important pages of our sites. In both files, I think that
web2py has job to do.

Another interesting element would be a “breadcrumb”. That’s a row of
internal links, located in top or/and bottom of the page as title.site
> title.page1 > title.page2 > title.page3. There a lot of snippets of
code in Django that implements a breadcrumb. Also, there a project in
google code in "http://code.google.com/p/django-breadcrumbs/ ".
Whats about Web2py??

And last, a 404 personalized page, that kindly redirects users to the
root, or show a list of links of the most visited pages, its very
appreciated.


3.- "Offer quality content and services" , "Write better anchor text",
“Use heading tags appropriately” “Optimize your use of images”

Well, I think with that, any framework has nothing to do. :)


4.- “Make effective use of robots.txt”.

Maybe all web2py application would be, by default, a robots.txt file
with, at least, this content:

User-agent: “
Disallow: /static/

A robots.txt is a good practice, simple to follow.


5. “Be aware of rel="nofollow" for links”.

As example of use, the google’s document example:

<a href=http://www.shadyseo.com/ rel=”nofollow”>Comment spammer</a>

Maybe interesting. As point the google doc:

“Setting the value of the "rel" attribute of a link to "nofollow" will
tell Google that certain links on your
site shouldn't be followed or pass your page's reputation to the pages
linked to. […]If your site has a blog with public commenting turned
on, links within those comments could pass your reputation to pages
that you may not be comfortable vouching for. Blog comment areas on
pages are highly susceptible to comment spam. Nofollowing these user-
added links ensures that you're not giving your page's hard-earned
reputation to a spammy site. Many blogging software packages
automatically nofollow user comments”

6. “Promote your website in the right ways” “Make use of free
webmaster tools”.

Well, that’s work for the webmaster, not frameworks… but maybe some
webmaster tools can offer ideas for implementing in web2py??

7. “Take advantage of web analytics services.”

I don’t know if with web2py is easy or not to access Analytics api,
but maybe would be interesting that web2py has access to this api by
default. Some frameworks has, for example, plone. (Yes, I know, plone
is a CMS, not a framework as web2py.).

Sorry for the excessive extension of this mail.

Regards.

puercoespin

unread,
Aug 23, 2010, 12:58:43 PM8/23/10
to web2py-users
Sorry, but the first link don't work. Insteand, http://www.google.com/support/webmasters/
and, in "help resources" can found the google doc in "search engine
optimization". There are useful articles and videos SEO related too.

Regards.

On 22 ago, 14:53, puercoespin <jzaragoza.puercoes...@gmail.com> wrote:
> On 12 ago, 00:23, mdipierro <mdipie...@cs.depaul.edu> wrote:
>
> > Could you provide a list of features you would like to see?
>
> > Massimo
>
> > On Aug 11, 4:52 pm, puercoespin <jzaragoza.puercoes...@gmail.com>
> > wrote:
>
> First of all, I want to indicate that I am not an expert inSEO, not
> in Python not inWeb2py. In fact, I am not expert in anything  :)
>
> I think that a good beginning to create a list of possible features
> that, in my opinion, it should haveWeb2pyin reference toSEO, would
> be the Google’s doc " Google's Search Engine Optimization. Starter
> Guide ", and it can be found in " http: //www.google.com/webmasters/docs/search-engine-optimization-starter-gui...
> ". It is a brief document, of only 22 pages, but very interesting and
> whose reading I recommend. In addition, it has links to go deeper into
> some treated topics, as well as to tools for webmaster related toSEO.
>
> What I am going to expose is a small summary of the document, as a
> list, of the elements that a web site must have in order that it could
> obtain a good positioning. I think that in some of them,web2pymight
> facilitate the fulfilment of these elements.
>
> 1.- "Create unique, accurate page titles", "Create unique title tags
> for each page", "Make use of the 'description' meta tag", "Use unique
> descriptions for each page", "Improve the structure of your URLs".
>
> When Google presents us a list of webs as result of a search, he
> presents first the title of the web, a small text, which can - or not
> - match with the text of the meta tag "description", and a url link to
> the web. So is very important put the major care in refilling this
> meta tags. So I think thatWeb2pymust to ask for title and
> description when created a new application. In order that every page
> has a title and a different description, depending on his content,
> maybe doing that the controller returning variables title and
> description??
>
> URL’s must included words that can be found in a user search. And
> reflected the web’s structure, if possible, clean and ordered. Also,
> if a user “cuts” some parts of a url, (www.exemple.com/an/url/very/
> large/  and user cuts /large, for example)  the reply not would be an
> stranger message. About url’s, I thinkweb2pydoes a good job.
>
> 2.-   "Make your site easier to navigate"
>
> Everything related to the user ease of navigation will be appreciated
> by the search engines. In fact, inSEO, accessibility and usability
> counts. So it's recommended a sitemap (lower case), that is a html
> file, generally located in the root, and with a hierarchy links of the
> pages of the site, maybe with its title and description. This file is
> aimed to human visitors.
>
> Also, it's recommended a Sitemap (upper case), That’s a xml file,
> aimed to search engines. With this file, the webmaster can inform to
> search engines about the frequency of changes of the web, or what are
> the most important pages of our sites. In both files, I think thatweb2pyhas job to do.
>
> Another interesting element would be a “breadcrumb”. That’s a row of
> internal links, located in top or/and bottom of the page as title.site> title.page1 > title.page2 > title.page3. There a lot of snippets of
>
> code in Django that implements a breadcrumb. Also, there a project in
> google code in "http://code.google.com/p/django-breadcrumbs/ ".
> Whats aboutWeb2py??
>
> And last, a 404 personalized page, that kindly redirects users to the
> root, or show a list of links of the most visited pages, its very
> appreciated.
>
> 3.- "Offer quality content and services" , "Write better anchor text",
> “Use heading tags appropriately” “Optimize your use of images”
>
> Well, I think with that, any framework has nothing to do.  :)
>
> 4.- “Make effective use of robots.txt”.
>
> Maybe allweb2pyapplication would be, by default, a robots.txt file
> with, at least, this content:
>
> User-agent: “
> Disallow: /static/
>
> A robots.txt is a good practice, simple to follow.
>
> 5. “Be aware of rel="nofollow" for links”.
>
> As example of use, the google’s document example:
>
> <a href=http://www.shadyseo.com/rel=”nofollow”>Comment spammer</a>
>
> Maybe interesting. As point the google doc:
>
> “Setting the value of the "rel" attribute of a link to "nofollow" will
> tell Google that certain links on your
> site shouldn't be followed or pass your page's reputation to the pages
> linked to. […]If your site has a blog with public commenting turned
> on, links within those comments could pass your reputation to pages
> that you may not be comfortable vouching for. Blog comment areas on
> pages are highly susceptible to comment spam. Nofollowing these user-
> added links ensures that you're not giving your page's hard-earned
> reputation to a spammy site. Many blogging software packages
> automatically nofollow user comments”
>
> 6. “Promote your website in the right ways” “Make use of free
> webmaster tools”.
>
> Well, that’s work for the webmaster, not frameworks… but maybe some
> webmaster tools can offer ideas for implementing inweb2py??
>
> 7. “Take advantage of web analytics services.”
>
> I don’t know if withweb2pyis easy or not to access Analytics api,
> but maybe would be interesting thatweb2pyhas access to this api by

Gael Princivalle

unread,
Jan 3, 2014, 9:25:14 AM1/3/14
to web...@googlegroups.com
Hi Bruno.

In a same page where you make translations, how can you manage meta informations for all languages ?
With a if T.accepted_language you can set different values, but when you give your site to a tool like that :
http://www.seoutility.com/it/tools/google/sitemap_generator.aspx
it see only meta informations in default language.


page title (response.meta.title)
page keywords
( response.meta.keywords)
page description
( response.meta.description)

How do you manage this argument ?

Thanks.

rajjm...@gmail.com

unread,
Jun 14, 2017, 3:21:03 PM6/14/17
to web2py-users
Did anyone had any success on inserting metadata on layout or SEO ( http://www.web2pyslices.com/slice/show/2048/simple-seo) plugins? It doesn't seem to work at all.

Carlos Cesar Caballero Díaz

unread,
Jun 15, 2017, 9:16:25 AM6/15/17
to web...@googlegroups.com

Hi, it seems to be working in my apps, can you share how are you using it, and the web2py version?

Greetings.


El 14/06/17 a las 15:21, rajjm...@gmail.com escribió:

rajjm...@gmail.com

unread,
Jun 16, 2017, 1:45:57 PM6/16/17
to web2py-users

I have this in index.html before {{extend 'layout.html'}}

{{ 
response.title='My Site Name' 
response.meta.keywords='web2py web development Denver' 
response.meta.description='my description' 
response.meta.author='my name' 
}} 

Most of the content of the page is in layout.html

#------------------------------------------------------------------------------------------------

I also installed the simple SEO plugins from slice and in my db.py I have:

#-------------------------------------------------------------------------------------------------

from plugin_simple_seo.seo import set_seo_meta

set_seo_meta(title='web2py-simple-seo', 
             author="daxSlab",
             description='Simple SEO metadata plugin for web2py including Open Graph and Twitter Cards',
             keywords='web2py consulting in Denver',
             card='summary',
             generator="Web2py Web Framework",
             url='http://myurl.com',
             site_name='my_site',
             locale='en_US')


For the above I am not sure what will be the url or the image. 

Anyway, I have both. Non works. 
Reply all
Reply to author
Forward
0 new messages