Skip to content
Read For Learn
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP

I would like to give special promotion for the first 100 posts in my blog? Can anyone tell me how to do that?

Here is what I would do:

Run an SQL query like so:

SELECT * FROM `wp_posts` WHERE `post_status` = 'publish' AND `post_type` = 'post' GROUP BY `post_author` ORDER BY `post_date` ASC  LIMIT 100

The above will give you the first 100 authors to have a post published. or:

SELECT * FROM `wp_posts` WHERE `post_status` = 'publish' AND `post_type` = 'post' ORDER BY `post_date` ASC  LIMIT 100

this will give you the first 100 published posts

Related Posts:

  1. is there a way to show the the post title after the image?
  2. wp_query with ajax
  3. How to get only current images of a post
  4. Ordering posts alphabetically by meta keys and title
  5. Keep featured content post in homepage with original order
  6. How to get posts published between a date and today?
  7. How to check if post meta key exists or not in wordpress database
  8. How to show related posts by category
  9. How to add category to: ‘wp-admin/post-new.php’?
  10. the_author() returns empty string
  11. How can I retrieve multiple get_post_meta values efficiently?
  12. Code to make a post sticky
  13. How to allow hidden custom fields to be added from wp-admin/post.php?
  14. Display all posts from specific categories on a page
  15. Export WordPress Posts and Meta Information in CSV format
  16. Delete duplicated wp_postmeta record
  17. How to exclude latest x posts from a paginated query?
  18. Will a large postmeta table slow a site down?
  19. Update all posts automatically when using post_meta
  20. Display content from a specific category
  21. How to display posts by current user/author in a custom page template?
  22. post_name empty after wp_insert_post
  23. How to batch update post content with custom post meta value
  24. Query posts distinct authors
  25. Change slug with custom field
  26. How to get previous 10 days post from a specific date – WP Query
  27. Number of posts per page setting is not working?
  28. Better post meta efficiency?
  29. WordPress Posts Out Of Order after 3.1 Update
  30. Setting post meta data to random value during post status transition / on publish
  31. Query only Posts from Both of Two Category?
  32. Insert custom div between posts
  33. Edit meta data does’t work with custom sql
  34. Can’t show comments count per post outside loop
  35. Only display posts with comments
  36. Human Time Diff, change mins to minutes
  37. Order post by year DESC and month ASC
  38. Change post format using custom field
  39. WordPress get posts by date without query_posts
  40. How to Display Post View Count
  41. Does WP get all post_meta on POST page?
  42. Different amount of posts on homepage than paged pages
  43. Sanitizing `wp_editor();` Values for Database, Edit, and Display
  44. Exporting Data from WordPress into a flat table
  45. Adding Multiple Values to a Post Meta Key
  46. Featured Posts for Category Pages
  47. Using radio button meta data from a custom meta box
  48. Cannot Update A Post, 404 Error
  49. Function to show random posts from a category
  50. Hiding posts in a list from specified categories
  51. How would I get 1 latest post from a query for 5 posts?
  52. PHP Notice error (when on 404 page)
  53. What Is meta_id In wp_postmeta?
  54. Filter Posts By Tag
  55. Can I set and show “important” post in my blog?
  56. Checking if a post with certain meta value exists
  57. Exclude posts with empty post_content in wp_query
  58. How to permanently delete a post meta entry?
  59. Add custom field automatically (add_post_meta) with value based on number of words of article
  60. How to generate numbers indistinguishable for the IDs of the posts
  61. Improving WP_Query for performance when random posts are ordered
  62. Modify WP_Post before processing
  63. Save re-arranged draggable post items to wordpress database
  64. Create dropdown list post
  65. Change post_date to post_modified date on post template?
  66. previewing my posts on static page?
  67. Exclude newest post from category X but show rest
  68. Reset Popular post query?
  69. Converting a dynamic piece of code using WordPress Loop into a static one using Post ID
  70. Inserting custom data to the_post() during loop
  71. How To Get Posts With A Specific Word
  72. Why WP_Query(‘showposts=5’) shows only 1 post?
  73. How can I sort posts by the date and a custom meta field?
  74. Get Meta Key Value While Saving Post
  75. Display posts with tag that matches current post title
  76. Why is querying posts messing up my pages?
  77. Display all posts that were published before full post on single.php
  78. Category Foreach keeps looping?
  79. Blog post per page setting conflicting with custom WP_Query?
  80. How to exclude latest x posts from a paginated query?
  81. Two loops, one AJAX loop, exclude posts in first loop from second loop, loops are in different files
  82. Force the “Choose from the most used tags” meta box section to always be expanded
  83. Meta value does not save for scheduled posts
  84. Custom Posts Query and meta_query Sort Order
  85. Random ajax load only works with posts_per_page set to -1
  86. How to compare two posts including their meta fields on a scalable base?
  87. Getting value from get_post_custom
  88. Display an author’s posts on his own author page
  89. Calling Different Custom Post Timestamps in a table
  90. Multi row post list
  91. Is it possible to paste a link without tags and make it directly a link in a post?
  92. Cannot retrieve a custom RSS field from posts
  93. posts_per_page option limits the number of Gallery items
  94. How to make multiple sections in home pulling posts category wise?
  95. Saving custom fields to a custom taxonomy
  96. wp_posts table: safely remove unused columns to save database storage
  97. Query Posts by Custom Field
  98. Order posts alphabetically: how to set order=asc in mysql query?
  99. How to order posts in an arbitrary order?
  100. How to automate featured posts number? [duplicate]
Categories posts Tags post-meta, posts, query-posts
Use main theme’s CSS for the outer wrapper in list-category-posts?
Remove Text within Header tags in the Excerpt

Recommended Hostings

Cloudways: Realize Your Website's Potential With Flexible & Affordable Hosting. 24/7/365 Support, Managed Security, Automated Backups, and 24/7 Real-time Monitoring.

FastComet: Fast SSD Hosting, Free Migration, Hack-Free Security, 24/7 Super Fast Support, 45 Day Money Back Guarantee.

Recent Added Topics

  • Bug in translation system: load_theme_textdomain() returns true, files are available and accessible but the language defaults to english
  • Custom Elementor controls not appearing in the widget Advanced tab using injection hooks
  • Get the name of the template/*html file used
  • Trying to Add Paging to Single Post Page
  • Sharing media files between live and staging servers
  • How to display the description of a custom post type in the dashboard?
  • Critical error on image display
  • Copying WP data and files into new install?
  • How to determine the DirectAdmin WordPress backup date?
  • How to get list of ALL tables in the database?
© 2026 Read For Learn
  • Database
    • Oracle
    • SQL
  • algorithm
  • asp.net
  • assembly
  • binary
  • c#
  • Git
  • hex
  • HTML
  • iOS
  • language angnostic
  • math
  • matlab
  • Tips & Trick
  • Tools
  • windows
  • C
  • C++
  • Java
  • javascript
  • Python
  • R
  • Java Script
  • jQuery
  • PHP
  • WordPress