I took a quick peek at the disqus plugin. This works in disabling the option before the plugin decides to print out the form.
add_filter( 'pre_option_disqus_active', 'wpse_conditional_disqus_load' );
function wpse_conditional_disqus_load( $disqus_active ) {
if( is_preview() ){
return '0';
}
return $disqus_active;
}
You could also try something like this (not tested)
add_filter( 'the_content', 'wpse_load_disqus');
function wpse_load_disqus( $content ){
if( is_preview() ){
return $content;
}
if( is_singular() ) { // displays on all single post types. use is_single for posts only, is_page for pages only
$content .= ?>
// You disqus script here
<?php ;
}
return $content;
}
Related Posts:
- Importing old Disqus comments into WordPress
- How to auto-approve internal pingbacks?
- How to show Disqus comment count number only without text?
- Using Disqus, how to stop storing comments in wp database?
- Disqus over the default commenting engine, what are some pros and cons?
- How to change style of Disqus comment count on main page
- Custom disqus_identifier not properly changing default value
- Disqus comments and pingback script – how to change the order?
- How to handle upvotes and downvotes of disqus comments after importing disqus comments to wordpress?
- I need to disable Disqus comments pre-approval, but i can’t find where
- Using Disqus with headless WordPress setup?
- How to import facebook comments to WordPress database?
- Disqus comments only show up on newest post
- Disqus moderation page not working in WordPress admin section
- Disqus resetting comment count to 0
- Comments from mobile apps & Disqus
- Migrate comments to Disqus
- Display DISQUS on homepage
- Is it possible to pull comments from facebook into your blog?
- Enable Submit Comment Without Page Reload (Using Ajax)?
- Getting Post Comments for post ID using WP_Query() and a Custom Loop?
- How to deal with small scale comment spam on small commercial sites? [closed]
- How to use a custom comments template
- Comment visibility
- Add placeholder attribute to comment form fields
- human_time_diff() returns “48 years ago” for all comments
- Allowing more elements in comments via functions.php
- Set post comments open function
- Why are default comments deprecated?
- Comments Reply Form
- An action hook where a comment meta is updated
- Last comment page first with full number of comments?
- Only subscriber role user can comment not other
- How to check if commenter is the_author?
- Strategies for coping with hyperagressive spambots?
- How to save new comment as custom comment type?
- How to remove the “on” string before recent comments link?
- WordPress comments email notification for authors
- How to get the result of comments_number() as a string instead of printing it out?
- WordPress unresponsive after calling wp_update_comment()
- How can I edit the Twenty Ten Theme to remove the comments box when a page uses a specific template?
- Highlight Author Comments issues
- wp_insert_comment and security
- How can I fix wp_insert_comment failure when ‘comment_content” includes slanted apostrophe in Excel csv source data
- Sort/list/arrange comments by comment author in un-nested/no thread comments
- The comment login form is visible to me but not to the user
- Archive comment w/o moving to spam/trash
- How to insert a comma to the child comment construction in function.php?
- Editing WordPress comments : generating comment from selection
- how to properly use comments-template.php
- How can I assign a specific id to the last comment of a post
- Reply By Email to comment notifications
- Modify WordPress Comment From For AMP Html
- delete duplicate comments
- wp_list_comments renders incorrectly nested
- Alternative to the filter comment_reply_link
- Number/ Position of a Comment
- code highiglight not working comment
- Comment number does not increment
- Cancel comment filter?
- Can I have Comments open to specific users only?
- How to edit the text below “Leave a Reply”
- Commenting system for WordPress
- Commentlist: bypostauthor problem with children list
- Comments does not work?
- comment_notes_before not working
- why can’t I retrieve the comment ID?
- How to create post comment from different domain
- get_comment_link without pagination base in the returned URL?
- Comments on future posts
- Comments_template doesn’t work
- Copy and Paste Password for Comments
- Display custom text when comments are closed
- Returning error upon comment being flagged as spam
- is it possible to have the full code instead in the comments.php page
- How do i remove approved spam comments by date?
- Remove Javascript generated by Comments
- How to Trigger comment_form_after action if comment_form() not used
- Need Comment Link Help
- How to only show current user’s comments and comments on current user’s posts in wp admin
- How to make author comment name to “Editorial Staff” no matter which ever author is replying to comments from his/her account?
- Changing the Comment Fields using Filter (without success)
- Comments pagination: reverse JUST the links texts (1-2-3 to 3-2-1), not comments order
- Display date and time into post edit comments section
- Disallowed Tag Present in AMP WordPress ()
- Subcriber getting multiiple notifications for new comments
- Limit Comment Line Count – Add Read More Button
- Comments/Discussion Not enabled on newly created posts/pages
- Commenter username copies author username
- How can I enable commenting from mobile view?
- How to force users to nest their comments
- jQuery to Create Button to Show/Hide WordPress Comments and to Hide Comments by Default
- Comment form – different title if no comment yet
- WordPress Comments jQuery Doesn’t submit
- Insert comment and still use moderation
- How to batch convert comments to posts?
- Customize comment notification e-mails with HTML
- I need help about wordpress of members section
- comment_approved custom value
- TinyMCE in comment reply form showing toolbar but can’t edit reply