Sometimes I have to work on WordPress sites that are too busy to display the admin interface. This can happen if there’s more traffic than the server can cope with. In such cases, we may need to tell every visitor to come back later while we carry out some maintenance.
But how? Thanks to an Apache command to block all IP addresses, except for our own. We can even display a “maintenance” page while we’re hard at work behind the scenes.
Let’s see how. Add the following to your .htaccess file in the web root directory, replacing 220.127.116.11 with your own IP address:
ErrorDocument 403 /maintenance.html
Allow from 18.104.22.168
Save the file on the server and see the site speed up as of by magic. No more requests but your own shall be processed henceforth.
Thanks to MickeyRush and b101101011011011 for this solution on Stack Overflow:
How do I find my own IP?
There are several services that will display the IP you’re currently connecting from. Head over to http://whatsmyip.org, or type “my ip” into Google.
Does this work with NGINX too
I’m sure the principle does, but I know very little about NGINX configuration. The above directive is for Apache only. If you know how this works in NGINX, please leave a comment below.
I’ve never liked themes with sidebars on the left – probably because we in the western world start reading on the left, and I’d like there to be as little clutter as possible. Or perhaps I’m used to navigation items on the right.
I was looking around for solutions to move the sidebar in Automattic’s TwentyFifteen theme to the right, and several options can be found on the internet. Here are two that worked for me:
Option 1: CSS Tweak
Thanks to the Stack Exchange community, this CSS tweak works a treat (for left-to-right languages):
margin: 0 35.2941% 0 0;
Add these declarations to your own TwentyFifteen Child Theme and you’re good to go. If added via a CSS widget or to the bottom of the original theme (which is a really bad idea), additional “!important” statements may be necessary.
Kudos to toschero and Anteru for the combined solution to this puzzle. Check out the full discussion here:
Option 2: Pre-made Child Theme
Ruhul Amin from Tips and Tricks HQ has built a ready-to-use child theme and solved this puzzle in PHP. You can check it out here: