Displays the contents of a post or page.
Previously “Post content” block.
This block is available in the latest version of WordPress and does not require the Gutenberg plugin.
Tips for using the Content block
The content block can be used in page templates and inside a query loop block. If the post content block is placed directly in the post or page content, you will see a notification saying that the block cannot be rendered inside itself. Doing that would create an infinite loop that would cause the page to break:
For developers
View source on GitHub
Block Grammar & Markup <!-- wp:post-content /-->
Context Context is used to pass values from a block to a descendant block; for example, a query and post template passing the query ID to the inner blocks.
Documentation
Uses context. Optional. Type: Object.
[
"postId",
"postType",
"queryId"
]
Block Attributes Optional. Type: Object.
Attributes provide the structured data needs of a block. They can exist in different forms when they are serialized, but they are declared together under a common interface.
Documentation
{}
Block Supports Optional. Type: Object.
A set of options that enables or disables block controls in the editor, for example gradient colors or padding.
Documentation
{
"align": [
"wide",
"full"
],
"html": false,
"layout": true,
"dimensions": {
"minHeight": true
},
"spacing": {
"blockGap": true
},
"color": {
"gradients": true,
"link": true,
"__experimentalDefaultControls": {
"background": false,
"text": false
}
},
"typography": {
"fontSize": true,
"lineHeight": true,
"__experimentalFontFamily": true,
"__experimentalFontWeight": true,
"__experimentalFontStyle": true,
"__experimentalTextTransform": true,
"__experimentalTextDecoration": true,
"__experimentalLetterSpacing": true,
"__experimentalDefaultControls": {
"fontSize": true
}
}
}
For developers
View blocks per attribute or block support:
Block Attributes
Select Block Attributes
__unstableLocation
addLinkToFeaturedImage
align
allowedBlocks
allowResize
allowResponsive
alt
area
arrow
aspectRatio
autoplay
avatarSize
backgroundColor
backgroundType
blockLayout
body
buttonBehavior
buttonPosition
buttonText
buttonUseIcon
byline
caption
categories
citation
columns
commentsToShow
content
contentPosition
controls
customBackgroundColor
customGradient
customIconBackgroundColor
customIconColor
customOverlayBackgroundColor
customOverlayColor
customOverlayTextColor
customText
customTextColor
description
dimRatio
direction
displayAsDropdown
displayAuthor
displayAvatar
displayDate
displayExcerpt
displayFeaturedImage
displayLayout
displayLoginAsForm
displayPostContent
displayPostContentRadio
displayPostDate
displayPreview
displayType
downloadButtonText
dropCap
excerptLength
featuredImageAlign
featuredImageSizeHeight
featuredImageSizeSlug
featuredImageSizeWidth
feedURL
fileId
fileName
fixedHeight
focalPoint
foot
format
gradient
hasChildren
hasFixedLayout
hasIcon
hasParallax
head
headings
height
href
icon
iconBackgroundColor
iconBackgroundColorValue
iconColor
iconColorValue
id
ids
imageCrop
imageFill
images
isDark
isLink
isNested
isRepeated
isSearchFieldHidden
isStackedOnMobile
isTopLevelItem
isTopLevelLink
itemsToShow
kind
label
largestFontSize
legacy
level
link
linkClass
linkDestination
linkLabel
linkTarget
linkTo
loop
maxNestingLevel
mediaAlt
mediaId
mediaLink
mediaPosition
mediaSizeSlug
mediaType
mediaUrl
mediaWidth
midSize
minHeight
minHeightUnit
month
moreText
muted
namespace
noTeaser
numberOfTags
onlyIncludeCurrentPage
opacity
openInNewTab
opensInNewTab
openSubmenusOnClick
order
orderBy
ordered
overlayBackgroundColor
overlayColor
overlayMenu
overlayTextColor
paginationArrow
parentPageID
placeholder
playsInline
poster
postLayout
postsToShow
prefix
preload
previewable
previewHeight
providerNameSlug
query
queryId
redirectToCurrent
ref
rel
responsive
reversed
rgbBackgroundColor
rgbTextColor
scale
selectedAuthor
separator
service
shortCodeTransforms
shouldSyncIcon
showAvatar
showBio
showCommentsCount
showContent
showDownloadButton
showEmpty
showHierarchy
showLabel
showLabels
showMoreOnNewLine
showOnlyTopLevel
showPostCounts
showPostTitle
showPrefix
showSearchTerm
showSubmenuIcon
showTagCounts
showTitle
size
sizeSlug
slug
smallestFontSize
src
start
suffix
summary
tagName
taxonomy
templateLock
term
text
textAlign
textColor
textLinkHref
textLinkTarget
theme
title
tracks
type
url
useFeaturedImage
userId
value
values
verticalAlignment
width
widthUnit
year
Block Supports
Select Block Supports
__experimentalBorder: color
__experimentalBorder: radius
__experimentalBorder: style
__experimentalBorder: width
__experimentalConnections
__experimentalExposeControlsToChildren
__experimentalLayout
__experimentalLayout: allowSizingOnChildren
__experimentalLayout: default flex
__experimentalLayout: default nowrap
__experimentalOnEnter
__experimentalOnMerge
__experimentalSelector
__experimentalSettings
__experimentalSlashInserter
__experimentalStyle
__unstablePasteTextInline
Align
align: center
align: full
align: left
align: right
align: wide
Anchor
ariaLabel
Background: backgroundImage
className
color: __experimentalDuotone
color: background
color: gradients
color: link
color: text
dimensions: minHeight
filter
inserter
interactivity
layout
position: sticky
shadow
spacing: blockGap
spacing: blockGap horizontal
spacing: blockGap sides horizontal
spacing: blockGap sides vertical
spacing: blockGap vertical
spacing: margin
spacing: margin bottom
spacing: margin top
spacing: padding
spacing: padding horizontal
spacing: padding vertical
spacing: units em
spacing: units px
spacing: units rem
spacing: units vh
spacing: units vw
typography: __experimentalFontFamily
typography: __experimentalFontStyle
typography: __experimentalFontWeight
typography: __experimentalLetterSpacing
typography: __experimentalTextDecoration
typography: __experimentalTextTransform
typography: fontSize
typography: lineHeight
units: em
units: rem
units: vh
units: vw