WP-discourse: how to deal with shortcodes in post

You can hide the post’s text with CSS by targeting a data attribute in your Discourse site’s theme. On WordPress, wrap the post excerpt in a div with a data attribute set to something like data-hide="true":

add_filter( 'discourse_publish_format_html', 'wpdc_custom_discourse_publish_format_html', 10, 2 );
function wpdc_custom_discourse_publish_format_html( $output, $post_id ) {
	$permalink = get_the_permalink( $post_id ) . '?embed=true';
	ob_start();
	?>
    <div data-hide="true">{excerpt}</div>
    <iframe width="690" height="600" src="<?php echo esc_url( $permalink ); ?>" frameborder="0"></iframe>
	<?php

	return ob_get_clean();
}

On Discourse, add something like this to your theme:

[data-hide="true"] {
    display: none;
}

I’m not sure how well this will work for SEO, but using a data attribute is a good way to add styles to posts that are published from WordPress.