My plugins are automatically inserting content into my sidebar and footer?
This is happening because you have enabled Visual Composer support via the Visual Sidebars Editor plugin, which allows you to insert Visual Composer elements in your sidebar and footer areas. If you don't need to display Visual Composer elements here go to Appearance > Sidebars Editor select the desired sidebars and click the green "Override widgets" button so it turns grey.
If you do need to add Visual Composer elements to your sidebar and footer areas you will need to edit the plugin that you are using.
In the plugin files you need to find the name of the function being used for the_content filter e.g.
add_filter( 'the_content', array( $this, 'custom_function_name' ) );
In this case it is "custom_function_name". Now search for the corresponding function e.g.
function custom_function_name( $content ) { if ( is_singular() ) { $new_content = '<p>This is added to the bottom of all post and page content, as well as custom post types.</p>'; $content .= $new_content; } return $content; }
You need to add an additional check called in_the_loop() so the content is only loaded in the main loop and not the sidebars and footer e.g.
function custom_function_name( $content ) { if ( is_singular() && in_the_loop() ) { $new_content = '<p>This is added to the bottom of all post and page content, as well as custom post types.</p>'; $content .= $new_content; } return $content; }
I suggest speaking with the plugin developers and asking them to make this a permanent change to their plugin as this is a common issue between plugins and themes as discussed at https://pippinsplugins.com/playing-nice-with-the-content-filter/