# Get content before the more tag

> I make heavy use of the more tag in posts and custom post types in WordPress It is a convenient way to quickly create an intro to a piece of content but WordPress doesn't have a handy method to access…
> URL: https://www.tring-web-design.co.uk/2020/06/get-content-before-the-more-tag/
> Last modified: 2020-06-23T09:49:04+00:00

I make heavy use of the more tag in posts and custom post types in WordPress

It is a convenient way to quickly create an intro to a piece of content but WordPress doesn’t have a handy method to access the content before the more tag.

Helpfully someone has already worked out how to do this on [wordpress.stackexchange.com](https://wordpress.stackexchange.com/questions/149099/only-show-content-before-more-tag)

```
// Fetch post content
$content = get_post_field( 'post_content', get_the_ID() );

// Get content parts
$content_parts = get_extended( $content );

// Output part before <!--more--> tag
echo $content_parts['main'];
```

If you are then going to echo out the content after the more tag, you will need to run the array through a filter to apply formatting

```
echo apply_filters('the_content', $content_parts['main']);
```

 
