You need to enable JavaScript to run this app.
最新活动
大模型
产品
解决方案
定价
生态与合作
支持与服务
开发者
了解我们

WordPress wp-content/languages目录语言文件上传后自动删除问题求助

Troubleshooting WordPress Language File Auto-Deletion Issues

Hey there, sorry to hear you're stuck with this annoying language file deletion issue on WordPress. Let's walk through practical fixes tailored to the two scenarios you described—files getting deleted right after upload, or vanishing an hour later:

Common Checks First

  • Verify directory and file permissions
    This is the most frequent culprit. The wp-content/languages directory should have permissions set to 755, and individual language files (like .mo or .po) should be 644. You can adjust these via FTP, SFTP, or your hosting control panel. Incorrect permissions can trigger security tools or server scripts to flag and delete the files.

  • Disable security plugins temporarily
    Tools like Wordfence, iThemes Security, or Sucuri often run real-time scans for "unauthorized" files. If you uploaded custom language files (not the official WordPress ones), these plugins might mistake them for malicious content. Disable the plugin, re-upload your language files, and see if they stick around. If they do, add the languages directory or specific files to the plugin's whitelist.

Fixes for Instant Deletion

If files disappear right after upload, focus on real-time scanning systems:

  • Check server-side security tools
    Some hosts use ModSecurity or similar tools that block/delete files they deem suspicious. Reach out to your hosting support to temporarily disable ModSecurity for testing, or ask them to whitelist your language files.
  • Confirm file naming correctness
    WordPress expects language files to follow a specific naming convention (e.g., zh_CN.mo for Chinese Simplified). If your files have incorrect names (typos, wrong locale codes), WordPress might automatically delete them as invalid. Double-check the locale code matches what your site uses (you can find this in Settings → General).

Fixes for Deletion After One Hour

An hour delay points to scheduled cleanup tasks:

  • Inspect WordPress cron jobs
    Go to Tools → Site Health → Info → Cron Events to see if any plugin has added a scheduled task that cleans the languages directory. If you spot one, disable the plugin responsible or adjust its settings to exclude language files.
  • Check hosting auto-cleanup rules
    Many shared hosts run hourly cron scripts to delete "temporary" files. It's possible your host is targeting the languages directory by mistake. Contact your hosting provider and ask them to exclude wp-content/languages from their automatic cleanup routines.
  • Disable automatic language updates
    WordPress automatically updates official language packages by default. If you uploaded modified/custom language files, the auto-update might overwrite or delete them. Add this line to your wp-config.php file to turn off auto-updates for languages:
    define('WP_AUTO_UPDATE_LANG', false);
    

Final Tip

After trying each fix, re-upload your language files and monitor them for the timeframe you noticed the deletion. Start with the simplest checks (permissions, security plugins) before moving to server-level settings.

内容的提问来源于stack exchange,提问作者muhammed alsmawi

火山引擎 最新活动