Yes, index.php is part of core and is liable to be overwritten.
In fact, if you look at the process to manually update WordPress, step 7 is:
Upload all new loose files from the root directory of the new version to your existing WordPress root directory
That may include index.php.
You can put custom PHP code in a custom plugin or theme. If using a pre-built theme, first create a child theme and then put your code in that child theme’s functions.php.
Related Posts:
- Update to older wordpress version from admin?
- Find out if there is a available core update?
- wordpress update will overwrite files changes?
- Updating WordPress core with zero downtime – I mean zero
- Is there a way to schedule automatic WordPress core updates?
- How does one dismiss the ‘upgrade notice’ when managing upgrades with SVN?
- Where can I see all changes for a new WordPress version?
- Where does wordpress gets its core and plugin updates
- What do WordPress auto updates include?
- Updating wordpress from my Linux distro’s repository
- IP Address Whitelist to Allow WordPress Core Auto Updates
- How does WordPress get the upgrade URL?
- Plugins download & install fine, wordpress update fails
- Hook or function to check if performing a WP Core update?
- Get rid of Another update is currently in progress
- What is your best practice to execute one-time scripts?
- Enable update notification, disable updates
- Set custom messages for post update/save
- Real automated and unattended wordpress upgrade including plugins
- Auto-updating WordPress from a local zip file
- Permissions to get autoupdate to work
- Disable requests to api.wordpress.org
- Permissions to wp-content folder in Windows Server 2012
- Why is Google Webmaster Tools telling me to update WordPress
- Update, add, remove plugins, themes or wordpress behind load balancer
- How to force function to run as the last one when saving the post?
- Block updates by Server
- WordPress 5.5 AutoUpdate schedule
- WordPress Version 5 – Another update is currently in progress
- register_activation_hook and updating
- What are the details for function argument wp_update_plugin()
- Check if any users are logged in before running update
- How do I update a custom theme
- Changing plugin slug with update
- Necessary user, group and permissions for core updates
- Update Failed: There has been a critical error on your website
- How to notify my plugin users about new version releases?
- Can’t update WordPress, need to reboot the VPS
- Deploying Updated or New Plugins That Modify the wp_options Table
- Website not updating – no cache plugins active!
- What are the properties of $item passed in the auto_update_{$type} filter?
- Good methodology for upgrading a large/complex sites?
- Auto backup before automatic WordPress updates
- WordPress not showing upgrade to latest version
- Why does WordPress 4.2.2 require FTP to update?
- Updating client websites on a regular basis
- Why won’t WordPress on localhost find updates?
- How to do an event when any user updates their profile?
- Some wp-admin folder file deleted when WordPress upgrade
- How to display user’s nickname by default instead of username
- Apply a tag to every images ‘Link Rel’
- Download failed cURL error 7: . Can’t update anything
- Upgrading from 3.5.2 to 3.9.1
- Check for files and database integrity
- Install translation files that should survive updates [duplicate]
- Error updating WP-CLI
- Fresh new install or keep old version
- How to add new theme to running website
- Automatic updates and merging manual changes
- WordPress curl timing out and saying ‘Moved Permanently’
- New version doesn’t show up
- Updating a page won’t have any effect
- Keep getting update notifcations despite there is nothing to update
- 3.1 update erases customized function page?
- theme upgrade failing
- cannot update wordpress from 3.4.2 to 3.5
- What is a rock solid development and deployment workflow? [closed]
- getting notifications about updates only in the “core” page
- How to back up and up date a site to a newer version?
- How to automate post update website check?
- opcache_reset on plugin/theme/core update
- Which directories does WordPress attempt to create when updating core and installing plugins?
- Constant for ‘barebones’ update of WordPress
- Reliability of WordPress 4 one click update
- Can an update corrupt my installation?
- Can I Update WordPress 2.9.2. to 3.0.4 from admin
- WordPress managing dates that change in text regularly
- WordPress current version is 5.7.5 but I’m being prompted to “upgrade” to 4.9
- Can not save changes after an edit
- Admin keeps showing pending translation update
- Auto Update A WordPress Plugin from within another WordPress Manager Plugin
- How to force an update of WordPress core to a newer minor version, using the Dashboard?
- What happend if I update my website?
- WordPress Not updating – No Cache Plugins, Admin sees updates
- Remote site behind VPN – how to allow core & plugin updates?
- Update WordPress from non-public machine
- cannot update ftp credentials even when group owner has write access
- WordPress NOT notifying of new update in dashboard
- What could have changed all of the ' characters in my content to ' strings?
- Updating from WordPress 3.5.2 to 3.6 Errors
- Autoupdate shows current when I’m on 3.1
- Restoring from a Backup after Update
- WordPress 4.8.2 redirects back after install and asks to delete/change config
- Problem updating from 3.6 to 3.7
- Is updating from a zip file the same as a regular update? [closed]
- How to update WordPress plugins properly using git?
- Updating WordPress or plugins causes site issues (due to API, I think)
- Automated WordPress update failed to complete – but all updates fail with code -1
- add_editor_style not working after upgrade to WP v 6.2
- edit wordpress website automatically from a program