There is a section that should look like this:
defined( 'ABSPATH' ) || define( 'ABSPATH', __DIR__ . "https://wordpress.stackexchange.com/" );
require_once( ABSPATH . 'wp-settings.php' );
add_filter()
is available after that, you are probably using it too early.