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.

備註

  • Odoo provides several modules to help you build your website content, such as eCommerce, Blog, eLearning, and Forum.

  • All Odoo themes rely on the CSS Framework Bootstrap to render efficiently according to the device: desktop, tablet, or mobile, which positively impacts ranking in search engines.

Content optimization

To optimize a webpage’s SEO, access the page, then go to Website ‣ Site ‣ Optimize SEO.

SEO 最佳化

Meta tags

Meta tags are HTML elements that provide information about a webpage to search engines and website visitors. They play a crucial role in SEO by helping search engines understand the content and context of a webpage and attract visitors with appealing content. There are two types of meta tags in Odoo:

  • Title tags specify a webpage’s title and are displayed as a clickable link in search engine results. They should be concise, descriptive, and relevant to the page’s content. You can update the title tag of your webpage or keep it empty to use the default value based on the page’s content.

  • Description tags summarize the webpage’s content, often displayed in search engine results below the title. They are used to encourage the user to visit the page. You can update the description tag of your webpage or keep it empty to use the default value based on the page’s content.

備註

预览 卡显示标题和描述标签在搜索结果中的显示方式。它还包括页面的 URL。

關鍵字

关键词是搜索引擎优化的主要要素之一。为搜索引擎优化得当的网站与潜在访客使用相同的语言,搜索引擎优化的关键字可以帮助访客与您的网站建立联系。

您可以在 关键词 字段中输入您认为重要的关键词,然后点击 添加 查看这些关键词在您的内容(H1、H2、页面标题、页面描述、页面内容)中不同层次的使用情况以及在 Google 中的相关搜索情况。该工具还建议使用相关关键词来提高网站流量。网页中出现的关键词越多越好。

小訣竅

强烈建议每个页面只使用一个 H1 标题,以达到搜索引擎优化的目的。

用于社交分享的图片

在社交媒体上分享页面时,会选择你的徽标图片,但你也可以点击向上箭头上传任何其他图片。

備註

  • 社会预览 卡中,可以显示页面信息在共享时的显示效果。

  • 如果您修改了博客文章的标题或产品名称,更改将自动应用到网站的各个位置。当外部网站使用旧链接时,系统会通过:ref:`301 重定向 <website/pages/URL-redirection>`保持链接正常访问,同时保留原有的 SEO 权重价值。

圖片

图片大小对页面速度有很大影响,而页面速度是搜索引擎优化搜索引擎排名的重要标准。

小訣竅

使用 `Google 网页速度 <https://pagespeed.web.dev/?utm_source=psi&utm_medium=redirect>`_或`Pingdom 网站速度测试 <https://tools.pingdom.com/>`_比较网站的排名情况。

Odoo会自动压缩上传的图片并将其转换为`Webp`格式。有了这种文件格式,照片就会变小,从而提高页面加载速度,并因此在搜索引擎优化中获得更好的排名。在 Odoo 官方 主题 中使用的所有图片默认也会被压缩。如果您使用的是第三方主题,它提供的图片可能无法有效压缩。

要修改网站上的图像,请选择图像,点击 编辑,然后转到 自定义`选项卡,调整 :guilabel:`图像`部分中的 :guilabel:`格式

automated image compression

重要

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:

snippets in search engine results

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 Website ‣ Configuration ‣ Settings, scroll down to the SEO section, and click Edit robots.txt.

Example

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.

  • 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 Site ‣ Properties, click the Publish tab, and turn off the Indexed feature.

disabling the “Indexed” checkbox

Hreflang HTML tags

Odoo automatically includes hreflang and x-default tags in the code of your website’s multilingual pages. These HTML attributes are crucial in informing search engines about a specific page’s language and geographical targeting.

也參考

翻譯