Skip to content

Instantly share code, notes, and snippets.

@timwhitlock
Created March 9, 2017 09:53
  • Star 5 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
Prevents WordPress from automatically updating translation files in the global languages directory
<?php
/*
Plugin Name: Disable auto translation updates
Description: Prevents WordPress from automatically updating translation files in the global languages directory.
Author: Tim Whitlock
Version: 1.0
*/
/**
* https://codex.wordpress.org/Configuring_Automatic_Background_Updates#Plugin_.26_Theme_Updates_via_Filter
*/
if( function_exists('add_filter') ){
add_filter( 'auto_update_translation', '__return_false' );
}
@timwhitlock
Copy link
Author

timwhitlock commented Mar 9, 2017

Placing this file in the mu-plugins directory will prevent WordPress auto updates from overwriting translation files in the global "languages" directory at wp-content/languages.

This applies to core translations directly inside the folder, plus theme and plugin translations inside "languages/themes" and "languages/plugins" respectively.

Note that translation files inside the actual themes and plugins will being overwritten regardless.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment