WPML
สถานะ
เปิด
ปลั๊กอิน/ธีมที่เกี่ยวข้อง
Rank Math SEO
แท็กหัวข้อ
Compatibility

ภาพรวมของปัญหา

เมื่อใช้ Rank Math SEO ร่วมกับ WPML เนื้อหาของ shortcode rich snippet ของ Rank Math [rank_math_rich_snippet id="..."] จะไม่ได้รับการแปล

วิธีแก้ปัญหาชั่วคราว

ขั้นตอนที่ 1: ทำให้ฟิลด์แปลได้

  1. ไปที่ “WPML > การตั้งค่า > การกำหนดค่า XML ที่กำหนดเอง”
  2. เพิ่มข้อมูลต่อไปนี้แล้วคลิก “บันทึก”
    <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. ทำการแก้ไขเล็กน้อยในหน้าต้นฉบับแล้วบันทึก
  4. แปลหน้าดังกล่าว

ขั้นตอนที่ 2: ปรับ shortcode หรือใช้บล็อก Rank Math

  • shortcode [rank_math_rich_snippet id="..."] มี ID ที่ไม่ซ้ำกัน
  • ใช้ shortcode [rank_math_rich_snippet] แทน (โดยไม่มีแอตทริบิวต์ id)
  • หรือใช้ บล็อก Schema by RankMath แทน

ปัญหาที่ทราบแล้วทั้งหมด →