# Mini Program Search Optimization Guide

When a crawler visits a page inside an Mini Program, it carries a specific user-agent "mpcrawler" And Scene Value: 1129

How to determine if a request comes from an official search crawler:

The signature algorithm is consistent with that of the Mini Program message push interface.[details](https://developers.weixin.qq.com/miniprogram/dev/framework/server-ability/message-push.html#% E7%AC%AC%E4%BA%8C%E6%AD%A5%EF%BC%9A%E9%AA%8C%E8%AF%81%E6%B6%88%E6%81%AF%E7%9A%84%E7%A1%AE%E6%9D%A5%E8%87%AA%E5%BE%AE%E4%BF%A1%E6%9C%8D%E5%8A%A1%E5%99%A8)

The parameters are set in the header of the request and are: X-WXApp-Crawler-Timestamp X-WXApp-Crawler-Nonce X-WXApp-Crawler-Signature

The signature process is as follows:

  1. willtoken、X-WXApp-Crawler-Timestamp、X-WXApp-Crawler-NonceThree parameters for lexicographic sorting
  2. Concatenate three argument character strings into a string for sha1 encryption
  3. Developers get encrypted character strings that can be compared with X-WXApp-Crawler-Signature, identifying the request from WeChat.

# 1. Pages that jump in the Mini Program (url) Can be opened directly.

The jump url inside the Mini Program page is the important source that we crawler discovers the page, and the search engine recalls the result page (url) Must be able to open directly, independent of context state. Special: The parameters required for the suggested page are included in the url

# 2. The navigator component is preferred for page jumps.

The Mini Program offers two ways to route pages:
a. navigator assembly
b. routing API, including navigateTo / redirectTo / switchTab / navigateBack / reLaunch Suggested Use navigator Component, if you have to use the API, you can block the time lock or variable lock set for clicks when crawlers access.

# 3. Clear and concise page parameters.

Having a clear, concise structure and meaningful parameters QueryString Much help with grasping as well as subsequent analysis, but will JSON The way data is used as parameters is a poor implementation.

# 4. Only when necessary to request the user authorization, login, binding mobile phone number.

It is recommended to ask for user authorization only when necessary (for example, you can read articles anonymously and leave a name for comments).

# 5. We don't record web-view Any content in.

We can't do that for the time being, and we probably won't be able to in the long run.

# 6. Set a clear title and page thumbnail.

Page titles and thumbnails play an important role in understanding the page and improving exposure conversion. adopt wx.setNavigationBarTitle or Custom Forward Content onShareAppMessage Set the title and thumbnail of the page, and also for video、audio Component patching poster / poster-for-crawler Property.