Navigation überspringen

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.

Hinterlassen Sie eine Antwort

Bitte bleiben Sie beim Thema und respektieren Sie andere. Wenn Sie Hilfe bei Problemen benötigen, die nicht mit diesem Beitrag zusammenhängen, nutzen Sie unser Support-Forum, um einen Chat zu starten oder ein Ticket zu erstellen.

Sie können diese Tags verwenden:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>