Chuyển đến nội dung Chuyển đến thanh bên

Open

Topic Tags: Compatibility

Overview of the issue

When using Rank Math SEO with WPML, the content of the Rank Math rich snippet shortcode [rank_math_rich_snippet id="..."] will not be translated.

Workaround

Step 1: Make the fields translatable

  1. Go to “WPML > Settings > Custom XML Configuration”.
  2. Add the following and click “Save”.
    <wpml-config>
      <custom-fields>
        <custom-field action="translate">rank_math_schema_HowTo</custom-field>
        <custom-field action="translate">rank_math_schema_Article</custom-field>
        <custom-field action="translate">rank_math_schema_SoftwareApplication</custom-field>
      </custom-fields>
      <custom-fields-texts>
        <key name="rank_math_schema_HowTo">
          <key name="name" />
          <key name="description" />
        </key>
        <key name="rank_math_schema_SoftwareApplication">
          <key name="headline" />
          <key name="description" />
          <key name="review">
            <key name="negativeNotes">
              <key name="itemListElement">
                <key name="*">
                  <key name="name" />
                </key>
              </key>
            </key>
            <key name="positiveNotes">
              <key name="itemListElement">
                <key name="*">
                  <key name="name" />
                </key>
              </key>
            </key>
          </key>
        </key>
        <key name="rank_math_schema_Article">
          <key name="headline" />
          <key name="description" />
        </key>
      </custom-fields-texts>
    </wpml-config>
            
  3. Do a small modification to the original page and save.
  4. Translate the page.

Step 2: Adjust the shortcode or use the Rank Math block

  • The shortcode [rank_math_rich_snippet id="..."] includes a unique ID.
  • Use [rank_math_rich_snippet] shortcode instead (without the id attribute).
  • Alternatively, use the Schema by RankMath block.

Để lại trả lời

Vui lòng giữ đúng chủ đề và tôn trọng người khác. Nếu bạn cần trợ giúp với các vấn đề không liên quan đến bài đăng này, hãy sử dụng Diễn đàn Hỗ trợ của chúng tôi để bắt đầu trò chuyện hoặc gửi vé hỗ trợ.

Bạn có thể sử dụng các thẻ này:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>