recently I got deleted some of older posts, now AdSense crawler throws a continuous error so that I used a code to block AdSense on 404 pages,
I found an online solution,
The php-code snippet which hides/blocks Adsense ads on 404’s is:
ADD HERE YOUR ADSENSE CODE
Note: the logic of the code is to let Adsense run on all pages but the 404s!
And add below code into functions.php,
(this code throws error —- Your PHP code changes were rolled back due to an error on line 123 of file wp-content/themes/generatepress/functions.php. Please fix and try saving again.
syntax error, unexpected ‘)’