This thread is resolved. Here is a description of the problem and solution.
Problem:
The client has a site with hundreds of pages, some of which are not translated, some need updates, and some are up to date in terms of translation. The client is looking for a way to update all translations at once, instead of updating each page individually for each language.
Solution:
We informed the client that there is no built-in option in WPML to update all translations at once. However, if the client is translating content using the WordPress Editor and not relying on the Advanced Translation Editor, we provided a code snippet that could be used as a workaround.
First, ensure to back up the site and database. Then, add the following code to the
functions.php
file of the theme:
add_action( 'admin_init', 'save_all_posts_on_refresh' ); function save_all_posts_on_refresh() { global $pagenow; if ( $pagenow == 'edit.php' ) { $args = array( 'post_type' => array('page', 'post'), 'numberposts' => -1 ); $all_posts = get_posts( $args ); foreach ( $all_posts as $single_post ) { wp_update_post( $single_post ); } } }
After executing this code by reloading the Posts List on
/wp-admin/edit.php
, remember to remove the snippet from the
functions.php
file.
Please note that this solution might be irrelevant due to being outdated or not applicable to your case. If this does not resolve your issue, we highly recommend checking related known issues, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If you still need assistance, please open a new support ticket.
This is the technical support forum for WPML - the multilingual WordPress plugin.
Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.
This topic contains 1 reply, has 2 voices.
Last updated by 6 months, 3 weeks ago.
Assisted by: Andreas W..