Title: Child Theme functions.php &quot;Cannot modify header&quot; error
Last modified: August 20, 2016

---

# Child Theme functions.php "Cannot modify header" error

 *  [dasickle](https://wordpress.org/support/users/dasickle/)
 * (@dasickle)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/child-theme-functionsphp-cannot-modify-header-error/)
 * Hi,
 *  I have a child theme with a functions.php that I use to change some of the wp
   functionality. Everything was working fine until I added the follow code to the
   file
 *     ```
       <?php
       /**
       * No Feeds
       */
       function disable_feed() {
       wp_redirect( home_url() );
       exit;
       }
   
       add_action('do_feed', 'disable_feed', 1);
       add_action('do_feed_rdf', 'disable_feed', 1);
       add_action('do_feed_rss', 'disable_feed', 1);
       add_action('do_feed_rss2', 'disable_feed', 1);
       add_action('do_feed_atom', 'disable_feed', 1);
   
       function removeHeadLinks() {
             remove_action( ‘wp_head’, ‘feed_links_extra’, 3 );
             remove_action( ‘wp_head’, ‘feed_links’, 2 );
             remove_action( ‘wp_head’, ‘rsd_link’ );
       }
       add_action('init', 'removeHeadLinks');
       ?> 
   
       <?php
       function disable_category_tag_feed () {
        return;
        }
        add_filter('category_feed_link', 'disable_category_tag_feed');
       ?>
       ```
   
 * The code above prevents me from accessing /wp-admin and give me the following
   error: “Warning: Cannot modify header information – headers already sent by (
   output started at /home/arseniy/public_html/wp-content/themes/businesspro_child/
   functions.php:13) in /home/arseniy/public_html/wp-includes/pluggable.php on line
   876”
 * What can I do?

Viewing 1 replies (of 1 total)

 *  [Christine Rondeau](https://wordpress.org/support/users/crondeau/)
 * (@crondeau)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/child-theme-functionsphp-cannot-modify-header-error/#post-3469873)
 * Can you try and remove the ?> and <?php except for the first one?
 * So change this to:
 *     ```
       <?php
       /**
       * No Feeds
       */
       function disable_feed() {
       wp_redirect( home_url() );
       exit;
       }
   
       add_action('do_feed', 'disable_feed', 1);
       add_action('do_feed_rdf', 'disable_feed', 1);
       add_action('do_feed_rss', 'disable_feed', 1);
       add_action('do_feed_rss2', 'disable_feed', 1);
       add_action('do_feed_atom', 'disable_feed', 1);
   
       function removeHeadLinks() {
             remove_action( ‘wp_head’, ‘feed_links_extra’, 3 );
             remove_action( ‘wp_head’, ‘feed_links’, 2 );
             remove_action( ‘wp_head’, ‘rsd_link’ );
       }
       add_action('init', 'removeHeadLinks');
   
       function disable_category_tag_feed () {
        return;
        }
        add_filter('category_feed_link', 'disable_category_tag_feed');
       ```
   

Viewing 1 replies (of 1 total)

The topic ‘Child Theme functions.php "Cannot modify header" error’ is closed to 
new replies.

## Tags

 * [child theme](https://wordpress.org/support/topic-tag/child-theme/)
 * [header error](https://wordpress.org/support/topic-tag/header-error/)

 * 1 reply
 * 2 participants
 * Last reply from: [Christine Rondeau](https://wordpress.org/support/users/crondeau/)
 * Last activity: [13 years, 3 months ago](https://wordpress.org/support/topic/child-theme-functionsphp-cannot-modify-header-error/#post-3469873)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
