Title: Get Post length
Last modified: August 19, 2016

---

# Get Post length

 *  [danielgorges](https://wordpress.org/support/users/danielgorges/)
 * (@danielgorges)
 * [15 years, 6 months ago](https://wordpress.org/support/topic/get-post-length/)
 * Hi,
 * is there a possibility to get the length of every individual post? It´s necessary
   for a modification of my theme.
 * Greetz
 * dg

Viewing 1 replies (of 1 total)

 *  [MichaelH](https://wordpress.org/support/users/michaelh/)
 * (@michaelh)
 * [15 years, 6 months ago](https://wordpress.org/support/topic/get-post-length/#post-1738514)
 * You mean like:
 *     ```
       <?php
       $args=array(
         'post_type' => 'post',
         'post_status' => 'publish',
         'posts_per_page' => -1,
         'caller_get_posts'=> 1
       );
       $my_query = null;
       $my_query = new WP_Query($args);
       if( $my_query->have_posts() ) {
         while ($my_query->have_posts()) : $my_query->the_post(); ?>
           <p><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></p>
           <?php
         echo 'length of post content is '. strlen( $my_query->post->post_content);
         endwhile;
       }
       wp_reset_query();  // Restore global post data stomped by the_post().
       ?>
       ```
   
 * Related:
    [http://php.net/manual/en/function.strlen.php](http://php.net/manual/en/function.strlen.php)

Viewing 1 replies (of 1 total)

The topic ‘Get Post length’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 2 participants
 * Last reply from: [MichaelH](https://wordpress.org/support/users/michaelh/)
 * Last activity: [15 years, 6 months ago](https://wordpress.org/support/topic/get-post-length/#post-1738514)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
