Search sitemap configuration in mini program

Search sitemap configuration in mini program

WeChat has now opened search within mini-programs . Developers can configure whether their mini-program pages are allowed to be indexed by WeChat through sitemap.json configuration or by managing the backend page inclusion switch. When developers allow WeChat indexing, WeChat will index the page content of the Mini Program through crawlers. When a user's search term triggers the index, the Mini Program's page may be displayed in the search results. When a crawler accesses a page in a mini program, it carries a specific user-agent: mpcrawler and a scenario value: 1129. It should be noted that if the page data discovered by the mini program crawler is inconsistent with the presentation of the real user, the page will not be included in the index.

Sitemap Configuration

The sitemap.json file in the root directory of the Mini Program is used to configure whether the Mini Program and its pages are allowed to be indexed by WeChat. The file content is a JSON object. If there is no sitemap.json, all pages are allowed to be indexed by default; sitemap.json has the following properties:

Configuration items

property type Required describe
rules Object[] yes Index rules list

rules

The rules configuration item specifies the index rules. Each rule is a JSON object with the following properties:

property type Required default value Value Value Description
action string no "allow" "allow", "disallow" Whether the pages that match this rule can be indexed
page string yes "*", the path of the page * represents all pages and cannot be used as a wildcard
params string[] no [] A list of page parameter names (without parameter values) that may be used when the page specified by the page field is matched by this rule.
matching string no "inclusive" Refer to the matching value description When the page specified by the page field is matched by this rule, this parameter describes the params matching method
priority Number no Priority, the larger the value, the earlier the rule is matched, otherwise it is matched from top to bottom by default

matching value description

value illustrate
exact When the parameter list of the mini program page is equal to params, the rule hits
inclusive When the parameter list of the mini program page contains params, the rule hits
exclusive When the intersection of the parameter list of the mini program page and params is empty, the rule hits
partial When the intersection of the parameter list of the mini program page and params is not empty, the rule hits

Configuration Example

Example 1

 {
  "rules":[{
    "action": "allow",
    "page": "path/to/page",
    "params": ["a", "b"],
    "matching": "exact"
  }, {
    "action": "disallow",
    "page": "path/to/page"
  }]}
  • path/to/page?a=1&b=2 => Priority index
  • path/to/page => not indexed
  • path/to/page?a=1 => not indexed
  • path/to/page?a=1&b=2&c=3 => not indexed
  • All other pages will be indexed

Example 2

 {
  "rules":[{
    "action": "allow",
    "page": "path/to/page",
    "params": ["a", "b"],
    "matching": "inclusive"
  }, {
    "action": "disallow",
    "page": "path/to/page"
  }]}
  • path/to/page?a=1&b=2 => Priority index
  • path/to/page?a=1&b=2&c=3 => Priority index
  • path/to/page => not indexed
  • path/to/page?a=1 => not indexed
  • All other pages will be indexed

Example 3

 {
  "rules":[{
    "action": "allow",
    "page": "path/to/page",
    "params": ["a", "b"],
    "matching": "exclusive"
  }, {
    "action": "disallow",
    "page": "path/to/page"
  }]}
  • path/to/page => priority index
  • path/to/page?c=3 => Priority index
  • path/to/page?a=1 => not indexed
  • path/to/page?a=1&b=2 => not indexed
  • All other pages will be indexed

Example 4

 {
  "rules":[{
    "action": "allow",
    "page": "path/to/page",
    "params": ["a", "b"],
    "matching": "partial"
  }, {
    "action": "disallow",
    "page": "path/to/page"
  }]}
  • path/to/page?a=1 => Priority index
  • path/to/page?a=1&b=2 => Priority index
  • path/to/page => not indexed
  • path/to/page?c=3 => not indexed
  • All other pages will be indexed

Note: If there is no sitemap.json, all pages can be indexed by default

Note: {"action": "allow", "page": "*"} is the default rule with the lowest priority. All pages without "disallow" are indexed by default.

<<:  Community operation: How can community fission activities achieve high conversion rates?

>>:  The 4 user quadrants of product promotion!

Recommend

How to make your copywriting as popular as Jay Chou’s lyrics?

The reason why Jay Chou's songs are timeless ...

Twelve ultimate methods of WeChat promotion, the latest in 2015

【Micro Promotion】Twelve WeChat promotion methods ...

How do Internet finance platforms retain users?

Although new media operations cannot effectively ...

What are the tasks that Foshan SEO personnel have to do every day?

Many people say that SEO is no longer effective, ...

In 2015, Internet Marketing Will Never Be Moral

Is China's Internet in a prosperous or chaoti...

Community operations: user acquisition and retention!

Everyone knows that a community is an organizatio...

Changning SEO training: How to do SEO optimization for your website

Optimization is a long-term thing, not a whim. If...

Ten Lectures on Event Planning and Promotion

Event planning is an important part of marketing ...