Headers already sent – WordPress core

I’m getting an error on my site regarding “headers already sent”: Warning: Cannot modify header information – headers already sent by (output started at ………/wp-admin/menu-header.php:161) in ……/wp-includes/pluggable.php on line 881 I read the WordPress FAQ that discusses this, but – as you can see – this error is caused by the WordPress core (and not … Read more

Redirect users on specific post category or category page

im trying to redirect users on specific categry with this hook: // Show app-data posts only to app users function user_redirect() { if ( is_category( ‘app-data’ ) ) { $url = site_url(); wp_redirect( $url ); exit(); } } add_action( ‘the_post’, ‘user_redirect’ ); But its not working and i dont know why. it redirect if the … Read more

Redirect if not logged in?

I’ve tried this to redirect people who aren’t logged in to certain page. It ultimately shouldn’t matter what front end page they visit, but should redirect to whatever page is chosen as the landing page (which I’m assuming would be the URL in the wp_redirect). I still need access to wp-login and dashboard etc… I … Read more

wp_redirect “headers already sent” after front-end submission form

I’m trying to practice with setting up a front-end post submission form. And I’m getting this error: Warning: Cannot modify header information – headers already sent by (output started at /home/sadlight/public_html/members/wp-content/themes/default-child/announcement-submit.php:1) in /home/sadlight/public_html/members/wp-includes/pluggable.php on line 876 announcement-submit.php is my template below. I’ve tried this solution, but no go. Also, when I use wp_redirect in my … Read more

Unable to get wp_redirect() working after adding a CPT via the front end

I am attempting to learn PHP by creating a relatively simple application built on wordpress, it is a basic CRM and I’ve made decent progress but have been stuck on some of the finer points. I’ve been having some serious ‘headers already sent’ problems with getting wp_redirect() working after a user creates a new customer. … Read more

Using a custom field value to redirect away from a 404 page

I’m moving from an old CMS to WordPress. The old articles are saved as posts and the new WordPress permalink is %post-id%. The old URL slug is unique and saved as a custom field for each post; the custom field name is “old_url”. For example: Post ID: 123 Custom field name: old_url Custom field value: … Read more