Place in your template’s index.php
the following piece of code:
$deny = array("127.0.0.1", "88.88.88.88");
if (in_array ($_SERVER['REMOTE_ADDR'], $deny))
{
header("Location: http://example.com");
die();
}
And just change the addresses of $deny
for the IP address or addresses you want to block.
Related Posts:
- Return $post_id when DOING_AUTOSAVE?
- Including Angle Brackets In Pre Sections
- Anchor Text code string is automatically modified by WordPress
- WordPress is converting & to & inbetween [code] brackets
- Notice: Undefined property: wpdb::$current_post What can be wrong?
- Where to save common libraries?
- source code: WP_INSTALLING vs. WP_SETUP_CONFIG in setup-config.php
- Sublime Video: Playlist which gets all attached videos
- Code Friendly Block Quotes
- Remove line breaks from ?
- How to fix a “globals” issue to avoid a rejected theme?
- Need resource on available functions and objects
- WordPress wp_insert_post() returns 0 but not not wp_error
- I want to remove the home page header image from all other pages
- Proper implementation/use of code/syntax highlighting
- How to remove all comments from JS, HTML, CSS files?
- What data validation we must use in different contexts?
- Need To Post Unformated Code
- Sidebar login: How do I get the username to show after “Welcome”?
- How to manage multiple wordpress project with shared code base
- Find Total Authors
- Why does HTML entities are still encoded in Code Block?
- How to create a checkbox to show/hide a field in WooCommerce checkout [closed]
- how to display google maps with javascript
- How to pass https://achecker.ca/ validator? [closed]
- How to write custom code on WordPress?
- Remove Metaboxes
- Google analytics won’t work in wordpress
- Where do I add an action hook & callback in my theme?
- How do I reset my footer.php to its original state? (theme: Origami)
- Commenting out in HTML editor breaks template
- wordpress prepare error
- Adding code to send referrer on login page
- Table styles disappear when updating content
- Manage recurring event time
- wp_editor save all content
- Need an elegant solution to declare the value of two variables based on the count of the post
- How to insert integration code for CRM?
- A good way to include snippets of code in both posts, pages and Event Manager Template files?
- Anchor Text code string is automatically modified by WordPress
- Return $post_id when DOING_AUTOSAVE?
- Changes in code only show after changing theme
- Code Highlighting in BlockQuote
- feed url problem
- Where do I go to add a tag before the closing body tag?
- How to get a variable number of posts per post type on the main loop?
- Create custom [sourcecode] shortcode, the right way?
- how to group custom post types
- How do I turn off wordpress comments ability to capture a users ip address?
- How do i structure my theme folder to avoid one huge list of files
- write in functions.php
- Pinterest Integration Using functions.php
- Check if a user already voted [closed]
- Successful or Error Message after running mysql code in functions.php
- Beautify WordPress HTML output without any plugins
- Date/time limitation of posts where function must be executed
- Connect Second Database to WordPress
- If in category to be inside of a function
- Hide wordpress field if data is empty in post!
- code suddenly appearing from my tempate second loop
- Latest post in a specific menu
- How to add an automatic refresh in WordPress for a Page/Post or an embedded OneDrive/Excel HTML Code?
- Blacklist IP After Using WordPress Plugin Detector?
- WordPress change Language not working
- How can this crude function be improved?
- WordPress code editor messed up my code!
- Loop don’t work within single.php page
- Comment IP Plugin – Fixing onfocus=’this.select()’
- Change of IP Address
- How to run wp cli from a wp hook?
- Fatal error: Uncaught Error: Call to undefined function get_header() [closed]
- IP addresses to block to stop WP auto-update?
- Show a different link based on IP
- redirect to a child theme based on the town of Internet users in france with the verification of the ip address
- Limit action in comment according to IP
- how to move another machine or server without dealing with IP
- Allow tags between shortcode in comments
- Author & date removal
- PHP code snippet to remove microdata
- Access web server in local LAN using domain name instead of IP
- Counting number of posts in multiple (sub)categories using shortcode
- remove edit link only for published post and pending post
- WordPress Sticky Post Count “Fix” Breaking Pagecount by 72 pages!
- How can I use javascript in specific posts without relying on a plugin?
- How to add specific posts to specific pages in WordPress?
- Code for cron to delete posts that contain specific expression (e.g. “unable to fetch” every 30 minutes
- WordPress redirect users from certain countries to subpage of language version
- Website Tablet Check Out Field Issue
- style.min.css code issue
- how to run a php code in widget?
- how to add number value in front for variable [closed]
- widget that will do shortcodes that user inputs
- How to add a class name to the ancestor of a post?
- Themes with variable width or single columns? I want to display source code
- Creating a press page for our project
- How do I upload my WordPress code files from previous website onto local host WordPress website?
- What’s the difference between IP address 0.0.0.0 and 127.0.0.1?
- What is the difference between Unix sockets and TCP/IP sockets?
- How to determine the hostname from an IP address in a Windows network?
- I want create woocommerec match products columns