Obtenez 3 recommandations concrètes pour votre site e-commerce

I'll send you an e-mail with 3 personalized tips on how to improve your online store (or get off to a good start).

  • 1 e-mail with my clear, actionable advice
  • 1 booster a few days later

If you don't follow up, no problem. You'll still leave with 3 useful leads.

Name
Email
Link to your site (if any)
What is your main objective?





Briefly describe your need or activity
Le formulaire a été soumis avec succès !
Une erreur s'est produite lors de l'envoi du formulaire. Veuillez vérifier à nouveau tous les champs du formulaire.

Key points

  • WPML does not automatically detect the slider ID in Smart Slider 3 shortcodes.
  • The wpml-config.xml file is not sufficient to manage this specific case.
  • The best method is to save the entire shortcode as a translatable string in WPML.
  • A small custom WordPress shortcode then displays the right slider for the active language.
  • The result: a cleaner, more reliable multilingual site, with no page duplication or hacks.

Translate Smart Slider 3 with WPML

You have set up a multilingual site with WPMLyou use Smart Slider 3 to create dynamic, visual sliders… and now you’re thinking :

“Here, it would be nice to have a different slider for each language.”

But here’s the thing: it’s not that easy to change sliders according to language. WPML doesn’t automatically detect the slider ID in the [smartslider3 slider="2"] shortcode, and you get stuck in the translation editor. There’s no field allowing you to replace that famous number “2”.

On the WPML side, there are several methods for translating custom shortcodes (see the official documentation here).
But in the specific case of Smart Slider 3, only the “Translate hardcoded texts inside shortcodes” approach really works. Other methods, such as attribute translation with wpml-config.xml, do not recognize numeric IDs as translatable content.

The good news? With just a few lines of code, you can set up a clean, super-efficient solution. Nothing complex, I promise: it’s quick to do, and we’ll take you through it step by step in this tutorial.

The problem with the Smart Slider 3 and WPML duo

When you add a slider to a page with Smart Slider 3, you use a shortcode of this type :

[smartslider3 slider="2"]

Simple, isn’t it? Yes… until you want to display a different slider for each language.

With WPML, you’d expect to be able to easily modify this shortcode in the translation editor. But you can’t:

  • The shortcode does not appear in the advanced translation editor.
  • WPML doesn’t provide a field for modifying the slider ID.
  • Even with a wpml-config.xml file, WPML ignores numeric attributes such as slider="2".

Result: you end up with the same slider for all languages, even if you’ve created a separate slider for English, German or Italian.

The simple (and reliable) way to display a multilingual slider

No need to complicate life with hacks or endless XML files.
The cleanest method is to save the slider shortcode as a translatable string via WPML, then automatically display the correct version of the slider according to the active language.

The idea is to translate the shortcode itself, like a classic sentence, rather than trying to modify its attributes (which WPML doesn’t manage with numeric IDs).

And the good news is that it takes just a few lines of code to set up. No need to be an experienced developer. Here are the 3 main steps:

  1. Save the shortcode as a translatable string.
  2. Translate this string for each language from the WPML interface.
  3. Create a WordPress shortcode that automatically displays the correct slider, based on the translated version of the channel.

We show it all just below

Tutorial: translating a Smart Slider 3 slider with WPML

Ready to display a different slider according to your visitor’s language? Here’s how to implement this logic in just a few minutes.

Étapes smart slider 3 et wpml

Time

15

Minutes

Cost

0

CHF

Tools

– Accès à WordPress
– Accès au fichier functions.php (ou plugin)
– WPML avec le module Traduction de chaînes activé

Hardware

– L’ID de chaque slider Smart Slider 3 à afficher par langue
– Le shortcode [smartslider3 slider="X"] pour chaque version

Set up Smart Slider 3 with WPML in 4 easy steps

Step 1: Save the shortcode as a translatable string

Add this code to your theme’s functions.php file, or to a small custom plugin:

do_action('wpml_register_single_string', 'SmartSlider', 'home_slider_shortcode', '[smartslider3 slider="5"]');

Replace 5 with the ID of the slider you wish to display in your site’s default language (for example, the French slider if this is your main language).

Step 2: Translate the string in WPML

1. Go to WPML → String Translation
2. Filter by domain: SmartSlider
3. Search for the string home_slider_shortcode
4. Add translations:
5. English → [smartslider3 slider="2"]
6 German → [smartslider3 slider="7"]
etc.

Step 3: Create a shortcode that automatically displays the right slider

Now add this code (in the same function.php file):

add_shortcode('translated_slider', function() { $shortcode = apply_filters( 'wpml_translate_single_string', '[smartslider3 slider="5"]', 'SmartSlider', 'home_slider_shortcode' ); return do_shortcode($shortcode); });
This shortcode will display the correct version of the slider according to the language active on the site. Magic

Step 4: Using the shortcode in Gutenberg or Elementor

In Gutenberg:
– Add a Shortcode block
– Paste : [translated_slider]
In Elementor:
– Add a Shortcode widget
– Insert : [translated_slider]
– And there you have it! Each language will display its own slider without page duplication or complicated conditional logic.

Why wpml-config.xml is not enough

WPML lets you configure the translation of shortcode attributes via a wpml-config.xml file.
In the case of Smart Slider 3 with WPML, you could write :

And indeed, in some cases, WPML will display a field to modify the value of the slider attribute, even if it’s a simple number like "2".

But beware: this solution is far from ideal.

Why?
Because WPML doesn’t know that this number corresponds to a slider ID. It displays it as a simple text string, with no context or explanation. Result:

  • The field is difficult to locate in the editor.
  • It is not clear to the translator.
  • And in some cases (page builders, widgets, blocks), the attribute may not appear at all, or may not be taken into account at display time.

That’s why we recommend a more reliable method: translate the entire shortcode as a WPML string, which guarantees consistent, comprehensible behavior in any language.

In short: the method that really works

Translating a Smart Slider 3 slider with WPML isn’t magic… but it’s not rocket science either. With a few lines of code and the right method, you can finally display the right slider in the right language, just as you’ve always wanted.

To remember:

  • Forget wpml-config.xml in this case
  • Save the complete shortcode as a WPML string
  • Use a small WordPress shortcode to display the translated version automatically

And there you have it: no more duplicating pages, no more tinkering in the editor. Your site is clearer, cleaner, and your visitors will see a slider that speaks their language – literally.

Frequently asked questions (FAQ)

Need help setting up this solution on your site?

Discover our expertise as a web agency or contact us for personalized support and optimize your multilingual site today.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *