Title: Block shortcode
Last modified: August 24, 2016

---

# Block shortcode

 *  [draig](https://wordpress.org/support/users/draig/)
 * (@draig)
 * [11 years ago](https://wordpress.org/support/topic/block-shortcode/)
 * I read the documentation, but I still am confused why to use the Block shortcode.
   It says you can then use shortcodes in the visual editor… but when I tried it
   by replacing Div’s with Block it added br tags that Div’s in the text editor 
   wasn’t.
 * Can you explain more clearly the expected benefit and use?
 * Thanks for a great plugin. Finding it has been a revelation after struggling 
   so much to figure out how to make custom loops via php templates.
 * [https://wordpress.org/plugins/custom-content-shortcode/](https://wordpress.org/plugins/custom-content-shortcode/)

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Author [Eliot Akira](https://wordpress.org/support/users/miyarakira/)
 * (@miyarakira)
 * [11 years ago](https://wordpress.org/support/topic/block-shortcode/#post-6153580)
 * Hello,
 * The block shortcode was implemented in response to a user request. The reasoning
   was that when you use HTML in the text editor and then switch to Visual mode,
   you cannot see the HTML tags like `<div>` and `<a>` — making them easy to be 
   accidentally deleted. So, by using block shortcodes, the HTML tags are visible
   and “protected”.
 * The extra `<br>` tags are caused by automatic formatting of post content. You
   can enable and use the [raw] shortcode to prevent this. That’s a good point, 
   I’ll include a note in the documentation for HTML blocks.
 * To be honest, I haven’t used this feature much except for testing that it works.
   Usually I put most HTML and shortcodes outside the post, and leave the visual
   editor for content only.
 *  Thread Starter [draig](https://wordpress.org/support/users/draig/)
 * (@draig)
 * [11 years ago](https://wordpress.org/support/topic/block-shortcode/#post-6153616)
 * Thanks for the explanation. That is clearer now… I had assumed that since Block
   was making it visible in the Visual Editor, that it was also protecting it too…
 *  Plugin Author [Eliot Akira](https://wordpress.org/support/users/miyarakira/)
 * (@miyarakira)
 * [11 years ago](https://wordpress.org/support/topic/block-shortcode/#post-6153619)
 * The automatic formatting is useful for text, but doesn’t work well with multi-
   line shortcodes and not easy to get around. So far, the best solution I found
   is to use [raw] or pull the shortcodes from outside the editor, as described 
   in the Get Started page of the reference.
 * But, your comment made me think. Maybe it makes sense to strip `<p>` and `<br
   >` tags (usually added by auto-format) from inside the block shortcodes by default.
   In that case, it would be necessary to add them manually with `[p]` and `[br]`.
   Hmm..but that would change its default behavior and could have unexpected results
   with existing code.. I’ll have to think about it some more.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Block shortcode’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/custom-content-shortcode_766976.svg)
 * [Custom Content Shortcode](https://wordpress.org/plugins/custom-content-shortcode/)
 * [Support Threads](https://wordpress.org/support/plugin/custom-content-shortcode/)
 * [Active Topics](https://wordpress.org/support/plugin/custom-content-shortcode/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/custom-content-shortcode/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/custom-content-shortcode/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [Eliot Akira](https://wordpress.org/support/users/miyarakira/)
 * Last activity: [11 years ago](https://wordpress.org/support/topic/block-shortcode/#post-6153619)
 * Status: not resolved