1

We upgrading Wordpress then some custom files deleted from wp-admin folder. but theme/template file not deleted.

  • What kind of "custom files"? Have you modified WordPress core? – Krzysiek Dróżdż Apr 2 at 5:54
  • @KrzysiekDróżdż, we create some custom file ie. custom contact us form report from admin – Soundararajan m Apr 2 at 5:57
  • And have you put these files in wp-admin directory? – Krzysiek Dróżdż Apr 2 at 6:01
  • @KrzysiekDróżdż, yes – Soundararajan m Apr 2 at 6:02
  • @Soundararajanm don't put any custom files in wp-admin or wp-includes directories. Create a site-based plugin for this. Please follow this guide for creating plugin : codex.wordpress.org/Writing_a_Plugin – Serkan Algur Apr 2 at 6:07
6

Both wp-includes and wp-admin folders contain core files of WordPress. You should never modify any of them, because it is crucial for WP to be able to change these folders during updates.

Almost the same is true for all WP files placed in root folder - wp-config.php is the only file that WP won’t overwrite for sure.

All your custom code should be placed in wp-content folder. But... To be more precise - the theme files should go into wp-content/themes and they should only define how the site looks, and all other functions should be coded as plugins and placed in wp-content/plugins.

And yes - if you modify any of core directories/files, then you’ll face this problem of overwriting after every update of WP.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.