• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

RESOLVED Warning: Cannot modify header information - headers already sent

Messages
1
Likes
0
Points
1
#1
Hello,

We had a problem with Dublicate Content on our website happy-pet-club.de, so we wanted to insert the following snippet on all pages of the domain, which contains the Canonical-tag.

Code:
<?php
$actual_link = "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
echo "<link rel='canonical' href=$actual_link>
?>
Since then the following problem occurs on all pages, also in the backend:
Code:
Warning: Cannot modify header information - headers already sent by (output started at /kunden/555370_51105_webseiten/happy-pet-club.de/wordpress/wp-content/plugins/insert-php/includes/class.execute.snippet.php:52) in /kunden/555370_51105_webseiten/happy-pet-club.de/wordpress/wp-includes/pluggable.php on line 1251

Warning: Cannot modify header information - headers already sent by (output started at /kunden/555370_51105_webseiten/happy-pet-club.de/wordpress/wp-content/plugins/insert-php/includes/class.execute.snippet.php:52) in /kunden/555370_51105_webseiten/happy-pet-club.de/wordpress/wp-includes/pluggable.php on line 1254
Since we cannot access the backend, we cannot remove the snippet.

We have already tried to delete the folder "insert-php" on the webspace and drag an unconfigured one onto it. This deactivates the plugin hard. But as soon as we activate it again, the error occurs again.

Is there a way to remove the faulty snippet? If necessary also from the database, if it is stored there?

Best regards,
Arthur Sliwa
 

Attachments

alexkovalev

Program developer
Staff member
Messages
267
Likes
19
Points
18
#2
Hi,

Do not despair! Even an experienced person can make mistakes. We created a secure mode for this case. Go into it and your snippets code will not be executed.
  1. Go to the safe mode by this link: http://your-site-name.dev/wp-admin/?wbcr-php-snippets-safe-mode
  2. Edit the snippet in which you made a mistake;
  3. Leave safe mode by clicking the link: http://your-site-name.dev/wp-admin/?wbcr-php-snippets-disable-safe-mode
Great, now you should not have any issues!

You must be logged in and have an administrator role to use safe mode!

Best regards, Alex