Skip to content

Instantly share code, notes, and snippets.

@webdados
Created October 11, 2018 11:44
Show Gist options
  • Save webdados/dc29f36572d7e3d54ac215d24d77e39f to your computer and use it in GitHub Desktop.
Save webdados/dc29f36572d7e3d54ac215d24d77e39f to your computer and use it in GitHub Desktop.
Unregister all strings of a specific textdomain from WPML
<?php
define('WP_USE_THEMES', false);
require('./wp-blog-header.php');
$domain = 'woocommerce'; //Change textdomain as needed
$arr = array();
$sql = sprintf( "SELECT id FROM ix_icl_strings WHERE context='%s'", $domain );
$strings = $wpdb->get_results( $sql );
foreach ( $strings as $string ) {
$arr[] = $string->id;
}
wpml_unregister_string_multi( $arr );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment