carmM
|
Background of the issue:
I am trying to update URLs in posts, but the changes do not persist. The issue can be seen on this page: hidden link. I have also provided a video illustrating what I see in the backend and what I have done to resolve it: hidden link.
Symptoms:
The content remains in English, and the links within the text are not updating as expected.
Questions:
Why are the URLs in my posts not updating?
How can I ensure the content is translated into French and the links are updated?hidden link
|
Andreas W.
Supporter
Languages:
English (English )
German (Deutsch )
Timezone:
America/Lima (GMT-05:00)
|
Hello,
Usually, after migrating the site, you should go to the WordPress Permalink settings and save them again.
This will reset the permalinks of the site and they will use the new site URL.
But when it comes to lanks that are placed directly into the content of pages or posts, means as raw text with HTML, then you usually would need to adjust those links manually.
It is not even really a WPML issues. You usually would experience the same issue on a site running without WPML.
I see Search & Replace plugin seems not to solve the issue.
Maybe you could try to fix the issue with a PHP snippet like this one:
function replace_site_url() {
global $wpdb;
$old_url = '<em><u>hidden link</u></em>';
$new_url = '<em><u>hidden link</u></em>';
$wpdb->query(
$wpdb->prepare(
"UPDATE {$wpdb->posts} SET post_content = REPLACE(post_content, %s, %s)",
$old_url,
$new_url
)
);
}
add_action('init', 'replace_site_url');
Adjust the URLs, then paste it to the functions.php file of your theme. Refresh the website and remove the snippet again.
If this will still not solve the issue, please take note that this is expected WordPress behavior and not a WPML issue.
Best regards
Andreas
|