Do you want to edit WordPress’s “index.php” and not have it be over written every time WordPress updates? Well There is a solution to this problem and it’s stupid simple.
Before you start chomping at the bit and commenting that you “SHOULD NOT” for any reason edit core WordPress files, let me get to my next point.
There are perfectly valid reasons for wanting to edit WordPress’s “index.php” file, usually it is a single line of code to include a class or set of PHP functions that you want at the very highest level of your website or application.
This solution lets you run code before WordPress begins, while not editing any WordPress Core files!