WPML

Tổng quan về sự cố

Khi sử dụng Rank Math SEO với WPML, nội dung của shortcode rich snippet của Rank Math [rank_math_rich_snippet id="...-2"] sẽ không được dịch.

Giải pháp tạm thời

Bước 1: Làm cho các trường có thể dịch

  1. Đi tới “WPML > Cài đặt > Cấu hình XML tùy chỉnh”.
  2. Thêm đoạn sau và nhấp vào “Lưu”.
    <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. Thực hiện một sửa đổi nhỏ trên trang gốc và lưu lại.
  4. Dịch trang.

Bước 2: Điều chỉnh shortcode hoặc sử dụng khối Rank Math

  • Shortcode [rank_math_rich_snippet id="...-3"] bao gồm một ID duy nhất.
  • Thay vào đó, hãy sử dụng shortcode [rank_math_rich_snippet] (không có thuộc tính id).
  • Hoặc sử dụng khối Schema by RankMath.

Tất cả lỗi đã ghi nhận