goran.anicic
posted this
28 November 2025
Hello Nicepage Team,
we’ve identified an issue in the WordPress plugin that may affect many websites where Nicepage is used as a page builder, even when no multilingual setup is configured.
On a single-language WordPress site (no WPML, Polylang, TranslatePress or any similar plugin installed), Nicepage still injects ?lang= into all internal links rendered on the front-end, for example:
https://site.com/celebrity-news/maye-musk/?lang=sr
https://site.comcategory/zenski-stav/?lang=sr
This behavior leads to:
• duplicate URLs pointing to the same content
• SEO issues (duplicate content, split ranking signals)
• unnecessary URL parameters added site-wide
• broken canonical consistency
After reviewing the plugin code, we found the exact source in:
/wp-content/plugins/nicepage/includes/translations/class-np-multi-languages.php
Specifically in:
public static function disable_server_cache_for_links_script()
This function injects the following JavaScript into , which forces ?lang= into every internal anchor:
function addLangToUrls(selector, attr) {
jQuery(selector).each(function() {
var url = jQuery(this).attr(attr);
if (url) {
if (url === '#' ||
url.startsWith('#') ||
url.indexOf('lang=') > -1 ||
url.indexOf('tel:') > -1 ||
url.indexOf('mailto:') > -1 ||
url.indexOf('<?php echo $domain; ?>') === -1
) {
return;
}
var urlParams = url.split('#');
var anchor = urlParams[1] ? '#' + urlParams[1] : '';
var concat = url.indexOf('?') === -1 ? '?' : '&';
url = urlParams[0] + concat + `lang=<?php echo $language; ?>` + anchor;
jQuery(this).attr(attr, url);
}
});
}
This script is loaded whenever this condition is met in the same file:
if (count(NpMultiLanguages::get_supported_langs()) > 1) {
NpMultiLanguages::pre_init();
}
However, even on a single-language site, Nicepage still considers more than one language (probably via internal settings), so the multilingual feature becomes active unintentionally.
Temporary local fix (for our site)
We stopped this behavior by changing one line in the JavaScript:
Original:
url = urlParams[0] + concat + lang=<?php echo $language;?> + anchor;
Updated:
url = urlParams[0] + anchor;
This immediately removed ?lang=sr from all internal links.
Suggested permanent solution (for the plugin)
One of the following would prevent this issue globally:
Only enable NpMultiLanguages::pre_init() when a multilingual mode is explicitly enabled in Nicepage settings (not just because more than one language exists internally)
Add a plugin option:
“Disable automatic lang parameter injection into internal links”
Disable this feature completely for single-language WordPress sites:
if (is_multisite() && count(...) > 1 && user_enabled_multilang === true) { ... }
This behavior is critical for SEO, and on content-heavy sites it can seriously impact indexing and rankings.
If you need any additional examples, full paths, or a sandbox link, we are happy to provide it.