# sitemap Configuration

Mini-Program search is now available. Developers can configure whether their Mini-Program pages are allowed to be indexed by configuring sitemap.json. It will establish an index for the Mini-Program's page content through a crawler. When a user's search query triggers this index, the Mini-Program's pages may appear in the search results.

# 1. sitemap Configuration

The sitemap.json file in the Mini-Program root directory 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 sitemap.json does not exist, all pages are allowed to be indexed by default. sitemap.json has the following properties:

# 1.1 Configuration Items

Property Type Required Description
rules Object[] Yes Index rule list

# 1.2 rules

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

Property Type Required Default Value Valid Values Value Description
action string No "allow" "allow", "disallow" Whether pages matching this rule can be indexed
page string Yes "*", page path "*" represents all pages; cannot be used as a wildcard

# 2. Configuration Example

{
  "rules":[{
    "action": "disallow",
    "page": "path/to/page1"
  }, {
    "action": "disallow",
    "page": "path/to/page2"
  }]
}
  • path/to/page1 => Not indexed
  • path/to/page2 => Not indexed
  • All other pages will be indexed

# 3. Special Cases Explanation

  1. If sitemap.json does not exist, all pages are allowed to be indexed by default;
  2. {"action": "allow", "page": "*"} is the lowest priority default rule. Pages not explicitly marked as "disallow" are indexed by default;
  3. The sitemap.json file content has a maximum size of 5120 UTF8 characters;
  4. For pages that are not suitable to be included by the platform, developers can also use sitemap.json to declare and handle them.

# 4. Disclaimer

If developers fail to follow the prompts and guidelines provided in this configuration for setting up the functionality, resulting in the display, disclosure, unauthorized access, or leakage of users' personal information, all legal responsibilities shall be borne by the developers.

If user information is inappropriately displayed or similar situations occur, we may take measures including but not limited to requiring developers to rectify within a specified period to ensure the security of user information.

© FinClip with ❤ , Since 2017