Search Engine Optimization (SEO)¶
Search Engine Optimization, often abbreviated as SEO, is a digital marketing strategy to improve a website’s visibility and ranking in search engine results (e.g., in Google). It involves optimizing various elements on your website, including its content, social sharing, URLs, images, and page speed.
注解
Content optimization¶
To optimize a webpage’s SEO, access the page, then go to
.
关键词¶
Keywords are one of the main elements of SEO. A website that is well optimized for search engines speaks the same language as potential visitors, with keywords for SEO helping them to connect to your site.
You can enter the keywords you consider essential in the Keyword field and click ADD to see how they are used at different levels in your content (H1, H2, page title, page description, page content) and the related searches in Google. The tool also suggests relevant keywords to drive your web traffic. The more keywords are present on your webpage, the better.
小技巧
It is strongly recommended to only use one H1 title per page for SEO.
图像¶
The size of images has a significant impact on page speed, which is an essential criterion for search engines to optimize SEO ranking.
小技巧
Compare how your website ranks using Google Page Speed or Pingdom Website Speed Test.
Odoo automatically compresses uploaded images and converts them to Webp
. With this file format,
photos are smaller, which increases the page loading speed and, therefore, gives a better ranking in
SEO. All images used in Odoo official themes are also compressed by
default. If you are using a third-party theme, it may provide images that are not compressed
efficiently.
To modify an image from your website, select the image, click Edit, then go to the Customize tab, and adapt the Format in the Image section.

重要
Alt tags are used to provide context to what an image is displaying, informing search engine crawlers and allowing them to index an image correctly. Adding alt tags keywords in the Description field is essential from an SEO perspective. This description is added to the HTML code of your image, and it is shown when the image cannot be displayed.
Advanced features¶
Structured data markup¶
Structured data markup is used to generate rich snippets in search engine results. It is a way for websites to send structured data to search engine robots, helping them understand your content and create well-presented search results.
By default, Google supports many rich snippets for content types, including Reviews, People, Products, Businesses, Events, and Organizations.
Microdata is a set of tags, introduced with HTML5, that help search engines better understand your content and display it in a relevant way. Odoo implements microdata as defined in the schema.org specification for events, eCommerce products, forum posts, and contact addresses. This allows your product pages to be displayed in Google using extra information like the price and rating of a product:

robots.txt¶
A robots.txt
file instructs search engine crawlers which parts of a website they are permitted to
access. Its primary purpose is to:
Prevent overloading the website: By guiding crawlers away from certain sections, robots.txt helps manage server load.
Control access to resources and detailed descriptions: It can prevent crawlers from accessing media files (images, videos), CSS stylesheets, and JavaScript files, and from reading the content (text) of specific pages.
When indexing your website, search engines first look at the robots.txt file. Odoo automatically
creates one robot.txt file available on mydatabase.odoo.com/robots.txt
.
注解
Reputable bots adhere to robots.txt; others may require blocking via Cloudflare on your custom domain.
Edit robots.txt¶
By editing a robots.txt file, you can control which site pages are accessible to search engine crawlers. To add custom instructions to the file, go to SEO section, and click Edit robots.txt.
, scroll down to theExample
If you do not want robots to crawl the /about-us
page of your site, you can edit the
robots.txt file to add Disallow: /about-us
.
重要
While robots.txt
prevents content from being crawled, it does not guarantee that a page
will not be indexed. A page can still appear in search results if it is linked to from other
crawled pages (indexed by “reference”). Google generally does not recommend using robots.txt to
block webpages that you wish to keep out of search results entirely.
Prevent a page from being indexed¶
To effectively prevent a page from appearing in search engine results, use one of the following methods:
noindex tag: Access the page’s properties and toggle the Indexed switch off.
注解
This option is not yet available for dynamic pages.
404 or 403: Configure the page to return a 404 (Not Found) or 403 (Forbidden) HTTP status code. These codes signal to search engines that the page does not exist or is inaccessible, leading to its eventual removal from the index.
403: Access the page’s properties and toggle the Visibility switch off or unpublish the page.
Google Search Console: Use Google Search Console to request the removal of specific URLs from Google’s index.
参见
网站地图¶
The sitemap points out website pages and their relation to each other to search engine robots. Odoo
generates a /sitemap.xml
file, including all URLs. For performance reasons, this file is cached
and updated every 12 hours.
注解
If your website has a lot of pages, Odoo automatically creates a Sitemap Index file, respecting the sitemaps.org protocol, grouping sitemap URLs in 45000 chunks per file.
Every sitemap entry has three attributes that are computed automatically:
<loc>
:页面的 URL。<lastmod>
: last modification date of the resource, computed automatically based on the related object. For a page related to a product, this could be the last modification date of the product or the page.<priority>
: modules may implement their priority algorithm based on their content (for example, a forum might assign a priority based on the number of votes on a specific post). The priority of a static page is defined by its priority field, which is normalized (16 is the default).
小技巧
To prevent pages from appearing in a sitemap, go to Publish tab, and turn off the Indexed feature.
, click the