initially created this script for just 1 dynamic IP and can be seen at this URL:

I modified their script to meet my needs:

  • Multiple dynamic IPs
  • Allow “allow from” to be inserted into a pre-existing htaccess configuration


To start, you MUST first manually enter the <Files wp-login.php> section into your htaccess file BEFORE first use. If your htaccess file already has this section, then lines 1 & 2 MUST start the section. Lines 3 & 4 can dynamically move down if you have your own wp-login.php configurations that you need to maintain; in other words, add your configuration data between lines 2 & 3. Note: Once you enter this section and save the htaccess file, you WILL NOT BE ABLE to access your WordPress site until your cron job is first run.


The cron entry setup is just like’s setup:

*/15 * * * * /bin/sh /usr/local/bin/ /var/www/ > /dev/null 2>&1

You may create multiple cron jobs for multiple dynamic DNS names:

*/15 * * * * /bin/sh /usr/local/bin/ /var/www/ > /dev/null 2>&1

*/15 * * * * /bin/sh /usr/local/bin/ /var/www/ > /dev/null 2>&1

And so forth…


And now the script: