Forum replies created

    Jim Blankenship
    Participant
    Posts: 1
    December 15, 2023 at 3:48 pm #49210

    Thanks for the suggestions. I believe I have resolved this error in a different fashion.

    From my research on the error, I have learned that this repeated error is likely a bot attempting to connect to the theme index.php file directly, rather than via WP as is the common method.

    Addition of a checker in the php of the theme’s index.php file to determine if WP is loaded avoids this error. Since it is not desired (in my use) to connect directly to the theme’s index.php file (could also be 404.php, archive.php or possibly others), adding this line only subverts the bad actor.

    This is the “checker” line:
    if ( !defined( ‘ABSPATH’ ) ) exit; // don’t allow to call the file directly

    It is added after the initial <?php tag, and before any other code in the index.php file, or whatever .php file is being attacked.