Replace Default Flags

You can replace the default flags by using a bit of coding:

1. Create an empty plugin like this:
https://gist.github.com/sareiodata/76f701e01db6685829db

Since this plugin will contain the new flags, you’ll have to include the plugin file inside a folder like /tp_custom_flags as well as to create /tp_custom_flags/flags subfolder where the new ones will be found.

2. Add the following code to the end of it:

/**
 * Change flags folder path for certain languages.
 *
 * Add the language codes you wish to replace in the list below.
 * Make sure you place your desired flags in a folder called "flags" next to this file.
 * Make sure the file names for the flags  are identical with the ones in the original folder located at 'plugins/translatepress/assets/images/flags/'.
 * If you wish to change the file names, use filter trp_flag_file_name .
 *
 */

add_filter( 'trp_flags_path', 'trpc_flags_path', 10, 2 );
function trpc_flags_path( $original_flags_path,  $language_code ){

	// only change the folder path for the following languages:
	$languages_with_custom_flags = array( 'en_US', 'es_ES' );

	if ( in_array( $language_code, $languages_with_custom_flags ) ) {
		return  plugin_dir_url( __FILE__ ) . '/flags/' ;
	}else{
		return $original_flags_path;
	}
}

3. Modify the code by editing the language codes list with the languages you wish to replace. In the example we are adding custom flags for languages en_US and es_ES. The rest of the flags will not change.

4. Make sure you place your desired flags in a folder called “flags” next to this file. Put both the folder and this file into another folder.

5. Make sure the file names for the new flags are identical with the ones in the original folder located at ‘plugins/translatepress/assets/images/flags/’.

6. Install this plugin via FTP (copy it inside wp-content/plugins) or create a zip archive with it and install it via the WordPress plugin upload functionality