WP Manifestindependent plugin directory
manifest / i18n / wpml-avada-button-link-fixer

WPML Avada Button Link Fixer

WordPress plugin that automatically fixes Avada Fusion Builder button links in WPML-translated pages – resolves correct translated URLs including translated slugs.

by SK Online Marketing · github.com/aimitsk/wpml-avada-button-link-fixer · website

0stars
0forks

Install

No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:

wp plugin install https://github.com/aimitsk/wpml-avada-button-link-fixer/archive/refs/heads/main.zip

Automatically fixes Avada Fusion Builder button links in WPML-translated pages. Instead of simply prepending a language prefix (/en/, /nl/ etc.), the plugin queries the WPML database to find the correct translated URL for each button link – including fully translated slugs.

The Problem

When using Avada Fusion Builder with WPML, button links in translated pages often still point to the original (default language) URL. Simply adding a language prefix doesn't work because WPML translates slugs too:

Button link in translation Result
/service/online-preisanfragen/ 404 – German slug on English page
/en/service/online-preisanfragen/ 404 – Prefix added but slug still German
/en/service/online-price-inquiries/ Correct translated URL

This plugin resolves the correct translated URL automatically.

Requirements

  • WordPress 5.0+
  • PHP 7.4+
  • WPML (active with at least one secondary language)
  • Avada Theme with Fusion Builder

Installation

  1. Download the latest release as ZIP from Releases
  2. In WordPress: Plugins > Add New > Upload Plugin > select the ZIP
  3. Activate the plugin

Or clone directly into your plugins folder:

cd wp-content/plugins/
git clone https://github.com/AImitSK/wpml-avada-button-link-fixer.git

Usage

  1. Go to Tools > Button Link Fixer
  2. Select the languages you want to fix
  3. Run a Dry-Run first to preview all changes
  4. Review the results – the plugin shows exactly which links will be replaced
  5. Run Live to apply the changes to the database
  6. Clear your cache (WP Rocket, etc.)

How It Works

  1. Loads all published translated pages for the selected languages from icl_translations
  2. Extracts all link="..." attributes from Fusion Builder shortcodes
  3. For each link, finds the original page via get_page_by_path()
  4. Queries WPML for the translated version of that page (wpml_object_id filter + direct DB fallback)
  5. Retrieves the correct permalink of the translated page
  6. Replaces the link in the page content

All languages are loaded dynamically from your WPML configuration – no hardcoded language lists.

FAQ

Does it work with other page builders? Currently only Avada Fusion Builder link="..." attributes are supported.

Is it reversible? The plugin modifies post_content directly. Always create a database backup before running Live mode. The Dry-Run mode lets you preview all changes safely.

Does it work with custom post types? It processes pages (post_page) by default.

Changelog

See CHANGELOG.md for a full history.

Contributing

Contributions are welcome! Please open an issue or submit a pull request.

License

This project is licensed under the GPL-2.0-or-later.


Developed by SK Online Marketing