Title: WordPress post rating without plugins?
Last modified: August 30, 2016

---

# WordPress post rating without plugins?

 *  [Advanced SEO](https://wordpress.org/support/users/jole5/)
 * (@jole5)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/wordpress-post-rating-without-plugins/)
 * Is there any simple post rating snippet which will work when page is cached. 
   There is many functions, for example this:
 *     ```
       <form method='POST' action="">
       <input type=hidden name=rate value=up>
       <input type=submit value=submit>
       </form>
   
       <?php
       if(isset($_POST['rate'])) {
       if($_POST['rate']=='up') {
       $rate=get_post_meta($post->ID,'up',true);
       $rate=$rate+1;
       update_post_meta($post->ID,'up',$rate);
       }
       if($_POST['rate']=='down') {
       $rate=get_post_meta($post->ID,'down',true);
       $rate=$rate+1;
       update_post_meta($post->ID,'down',$rate);
       }
       }
       echo "UP:".get_post_meta($post->ID,'up',true);
       echo "DOWN:".get_post_meta($post->ID,'down',true);
       ?>
       ```
   
 * from [rate your post without WordPress plugin](https://webdesigingcoding.wordpress.com/2011/01/13/rate-your-post-without-wordpress-plugin/http://).
   It works fine, BUT, only if user is logged in or site in not using any caching
   plugin like WP Super cache, or any other.
 * I guess it will need some java/Ajax script to work when page is cached?

The topic ‘WordPress post rating without plugins?’ is closed to new replies.

## Tags

 * [ajax](https://wordpress.org/support/topic-tag/ajax/)
 * [javasript](https://wordpress.org/support/topic-tag/javasript/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 0 replies
 * 1 participant
 * Last reply from: [Advanced SEO](https://wordpress.org/support/users/jole5/)
 * Last activity: [10 years, 9 months ago](https://wordpress.org/support/topic/wordpress-post-rating-without-plugins/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
