You can actually do this on the web host without actually any PHP code. Using the same procedure as is recommended to deny access to wp-config.php
, you can also deny access to upgrade.php
.
All you need to do is create a file named .htaccess
in wp-admin
and put the following in it:
<files upgrade.php>
order allow,deny
deny from all
</files>
What this does is it tells the web server software do deny access to upgrade.php
from everybody. That way if someone tries to access it, the server will return a 403 error instead.
This assumes your web host is running Apache as its web server software. If it is not, their support staff should be able to assist you.
Related Posts:
- password protected post policy
- Adding fields to the “Add New User” screen in the dashboard
- Displaying the number of updates available in the Admin area
- Which WP functions do you need to use esc_html() or esc_url() on?
- What’s the difference between admin_url() and get_admin_url() functions?
- How to influence the information displayed on widget inside wp-admin
- How to override admin-bar style
- TinyMCE custom styles remove class when switching styles
- Masking logout URL
- How do I create a new WP admin color scheme?
- AJAX handler throws 400 (Bad request) – why?
- wp-admin page is blank
- Replacing select2 in admin backend for all selects
- difference between add_object_page and add_menu_page
- How to fix a theme with page.php Default Template that accidentally deleted?
- Target a certain page within wordpress backend (admin) i.e. Pages > About
- How can I rename the WordPress AJAX URL? [duplicate]
- How to add a column to the Trash page?
- Comments to only be seen by their author
- How to change menu icon which is overriden (i.e. by WooCommerce) [closed]
- Custom roles can’t access to wp-admin
- WordPress Content Security Policy and Subresource Integrity
- Removing the main link to Jetpack from the menu
- Access / Filter block variations in Gutenberg, in WordPress 5.6
- How to remove howdy dropdown menu content
- Add Featured image column into wordpress admin on pages AND posts
- Selective Product Category for Carousel
- How to force field validation first, then its values saved durning edit profile?
- Move ‘current-menu-item’ class on #adminmenu li from Posts to Pages for Taxonomy Edit Screen
- How to auto refresh when user change postcode
- Force to use STRONG users password and implement rule to prevent REUSE [closed]
- Sections and tabs DRY – WordPress settings API
- How to install Segment on WordPress without a plugin
- Get First Child Page ID or Permalink in WordPress Admin
- Creating A New Admin Menu Tab For Theme Options
- wp_get_archives custom function broken since upgrading to WP 3.7.1
- wp-admin won’t load after setting wp-login custom url
- Wp admin – Set default value to 999 in comments
- Remove “Published On” inside wp-admin
- Where do i create my own function in wp-admin
- How to remove comment count column in Posts inside the admin dashboard?
- What is the text that appears beside the page titles in the list of pages in the WP admin?
- Auto log in hook is requiring a page refresh
- Sortable column (by numbers) in admin users
- error at login page in wordpress
- what is best way to keep track of changes made in wordpress website? [closed]
- Update to functions.php not showing in dashboard
- Add element to widgetpage
- Best way to disable sidebars on posts (only)?
- “options.php” not found
- User meta and public function security
- How to change a specific admin label
- How to change a meta value (of a published post) after X days.?
- Block all plug-ins from initiating redirection upon activation?
- How to add custom metakey to shop_order page’s searching function?
- Unable to login after registration
- Security when outputing wp_oembed_get code
- Insert Modal on user first login
- WP Enqueue Script Error
- admin-ajax.php & my wp-admin folder url showing in header
- Using wp_localize_script in template file – is it secure?
- What is wrong with functions.php? Fills error log with same error
- How to add next height number in Order Attributes inside the Add new page. [duplicate]
- WordPress not performing direct update
- Will my WordPress site become vulnerable after adding this functions which allows more HTML tags for subscribers?
- Changed functions.php file and now site is blank [closed]
- Setcookie not setting cookies anywhere except admin
- Secure way to add JS Script to WordPress filesystem
- install Segment on WordPress
- remove/hide wp-editor
- Use add_action within template
- How to modify get_the_excerpt() when post-format equals ‘quote’?
- How to use parent theme functions in child theme functions.php file?
- Function not saving unchecked checkbox
- Are innerHTML elements visible to jQuery functions?
- Removing parent theme CSS without editing parent theme
- What is the correct way to include my new functions and scripts in WordPress?
- two search forms on the same page
- How to override this theme function in child theme
- Getting out side of wp root folder from function.php using absolute path
- video.js not enqueueing?
- How do I register a new settings page? [closed]
- Include Jquery libraries in wordpress theme?
- Showing user profile data on front-end
- Function to replace comment’s accented characters before posting
- wp_nav_menu work in functions.php but not in the theme
- How to register a menu based on a ACF condition
- get_template_directory() – references parent theme directory
- widgets not working
- WooCommerce -> wc_enqueue_js not working [closed]
- Use existing image sizes for WooCommerce
- Only echo Page Content (not page title & page content together)
- Function that prevents users from uploading photos more photos
- How do I display a date correctly that is stored in the database as a backwards 8 digit number from Advanced Custom Fields? [closed]
- How to convert raw url to hyperlink?
- Insert function insde body tag
- Shortcode to get featured image of specific id post
- Split single-review.php to two parts
- Modify shortcode to work with custom post types
- How to hightlight all ancestor menu items of a child page NOT displayed in menu