Hide blocks on a page not found in Drupal

I have google adsense in a block and I want to hide the block when the page is a Page not found error page. It is against TOS ads to show your ads on error pages. I suppose there should be a way to write a php script to specify the page visibility options. Does anyone know how to do this?

+2


source to share


2 answers


You can select specific pages to be displayed on errors if you go to / admin / settings / error -report



You should be able to use the block path parameters to exclude the use of the block in these pages.

+1


source


You can create a custom error page and name it 404.htm and 403.htm and create the ones listed as "Don't show by".



You can do this via Settings> Error Reporting

0


source







All Articles