Pular para o conteúdo Pular para a barra lateral

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.

Deixe uma resposta

Por favor, mantenha-se no tópico e seja respeitoso com os outros. Se precisar de ajuda com questões não relacionadas a este post, use nosso Fórum de Suporte para iniciar um chat ou enviar um ticket.

Você pode usar estas tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>