You can’t prevent comments_template()
from making an SQL query. Well, you could maybe hook into the DB layer to prevent just that specific query, but that would be very cumbersome to do. If this is for a theme, you could just remove the call to comments_template()
and replace it with your own function. comments_template()
doesn’t do that much: just load all the comments, maybe also the just-submitted comment if it isn’t approved yet, separate them into pings, trackbacks and regular comments if needed, and load the comments template file. Comments paging is relatively young in WordPress, so it’s probably not as efficient as it could be yet.
Related Posts:
- Fastest way to get the comment and ping total count for a post
- Getting $comments outside the comment template
- Comment filtering (search)
- How to find if a post with custom_field == X exists?
- WP_Query with the “offset” argument
- Custom Database Table and foreach
- Getting Post Comments for post ID using WP_Query() and a Custom Loop?
- Backup the Database and Restore from the Backup?
- How to remove comment section from page only , not from posts pages?
- Need help with friendly URL’s in WordPress
- Modify column_author in WP_Comments_List_Table
- Archive Listings Filtered by Date Values in a Custom Field/Post Meta?
- difference between esc_attr(), strip_slashes(), strip_tags()?
- Adding Custom Fields to WordPress Comment Forms?
- Change comments form title on a page by page basis
- media_handle_upload weird thing
- Can I use $wpdb for my custom tables in the WordPress database?
- Limit comments displayed on basis of user_id
- Get number of comments after modifying comment query
- Suggestions for WPMU Migration (advanced)
- Retrieve and display data from custom db table in admin area?
- Custom search page and search by title, content and tag
- if statement on database query
- Multiple Queries and Excluding Repeating Posts?
- How can I & how do I change text displayed in comment via child theme
- How to display custom field on homepage
- multiple comment text areas
- Add filename to attachment page url
- Count widgets of a certain type
- Recent comments from my blogs only
- Widget Javascript code (ajax)
- Comments not nesed with custom template
- What’s the proper way to use a custom table? [closed]
- How to retrieve the value stored in a multi-dimensional array and SUM the entries?
- Comments Confusion
- Get total number of comment of the posts written by an author
- How to create and work with custom data / tables (i.e., for arbitrary data)?
- show the meta values to visitors that collected via coment form
- Adding a Table to the wordpress database
- Creating user relationships
- Add Div to Comment Form
- database interactions using OOP
- Create WP_Query to search for posts by their categories or their parent/child categories
- Author Tracking Code!
- want to create a subcategory.php to manage subcats
- Customize Theme comment template to Insert VoteUp and VoteDown buttons
- changing font size and font of a custom message added after comment
- Custom comments list, right depth
- How to use default WP form elements to interact with custom DB table?
- Redirect to another page using contact form 7? [closed]
- Your thoughts on the interaction with one custom database table from WP?
- Adding comments to my custom theme
- Exclude posts with specific metadata from search?
- How to retrieve the data from the sever and displaying it in a page?
- Applying WP-cli Search & Replace to Static SQL Dump File
- Setup database structure with books, authors, languages etc. for publishing house [closed]
- Comment “like” problem – “users who like this” avatar linking to current user profile instead of “liker’s” profile
- Customizing Comments
- Attach File Funcion for Common people
- How to use multiple check-box values to work in a function and insert values in database
- How Can I Always Display A Particular Post First Using WP_Query?
- optimal taxonomy or custom post types
- What is my error trying to create a new table in the database?
- Delete post meta by serialized meta value
- Migrating my site to a new domain does not keep any changes made in customizer
- How can I style the Comment Section of a blog post
- New Page/Post Screen Opens an Existing Post
- How to extend WP_query to a specific table?
- Advice on how to structure a custom plugin
- How to have differents sites share the same tables of DB?
- Automatically reject a comment if website field contains anything
- Custom Avatars for WordPress Comments VIA Website URL?
- How to fix slow comment query?
- Real time notification on user profile after new comment
- Custom Form Input not saving to Database
- Show comments based on user role in front end
- Accountless password generation
- direct query to post_meta table
- Weird Behaviour: Not all WordPress Posts appearing
- Add several fields from different tables to post, fields per post are in same row of table
- Use custom get results query to show posts WordPress
- Where should I put this custom data?
- Show WP content on different PHP Sites
- Best way to define a database with product codes and back-end support?
- Edit a custom admin page
- Database custom table issues – incorrect result displayed
- Check if values exists DB
- Changing starting number of User ID
- Customized Comment Form Issues
- MySQL Engine vs. Charset
- Changes in comments.php in the child theme does not show up on the site
- Accessing + retrieving custom database in WordPress
- How to fix vanilla comments extra iframe space
- Post thats in Two Categories, only want to display name for one
- Custom Slider Per Page created
- Custom query_posts() parameter
- Getting Custom Field value in WP_Query
- Advice how to connect custom database with WordPress, change data in WordPress and finaly use this data
- Execute multiple PHP Snippets causes error?
- Changes to code not displaying