Title: editor default content
Last modified: November 28, 2021

---

# editor default content

 *  [anafasia](https://wordpress.org/support/users/anafasia/)
 * (@anafasia)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/editor-default-content/)
 * I have just updated WordPress after a long time.
    I’ve been using a plugin -My
   Default Post Content– that allowed me to define a default code showed when I 
   started a post. but, with the new editor, it doesn’t work.
 * to solve that, at theme functions they wrote me a code:
 *     ```
       // ===================generating default post content =======================
   
       add_filter( 'default_content', 'my_editor_content' );
       function my_editor_content( $content ) {
           $content = '<div><span class="bodytitle">Subtítulo</span></div>
   
       	IMAGEN
   
       	<p><span class="credit">créditos</span></p>
   
       	Cuerpo<!--more-->
       	_
   
       	GALERÍA';
           return $content;
       }
       ```
   
 * and using another plugin –Classic Editor– it works. but Classic Editor does not
   use the more recent editor blocks editor of wordpress.
 * there what is shows by default is:
 * ![Imagen ejemplo](https://i0.wp.com/i.imgur.com/JCnCfqM.jpeg?ssl=1)
 * I should need something like that:
 * instead of:
    <!– wp:gallery {«linkTo»:»none»} –> <figure class=»wp-block-gallery
   columns-0 is-cropped»><ul class=»blocks-gallery-grid»></figure> <!– /wp:gallery–
   >
 * this:
    <div><span class=”bodytitle”>Subtítulo</span></div> IMAGEN <p><span class
   =”credit”>créditos</span></p> Cuerpo<!–more–> _ GALERÍA
 * is there a way to reach that?
    -  This topic was modified 4 years, 6 months ago by [anafasia](https://wordpress.org/support/users/anafasia/).
    -  This topic was modified 4 years, 6 months ago by [anafasia](https://wordpress.org/support/users/anafasia/).
    -  This topic was modified 4 years, 6 months ago by [anafasia](https://wordpress.org/support/users/anafasia/).
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Feditor-default-content%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  Moderator [bcworkz](https://wordpress.org/support/users/bcworkz/)
 * (@bcworkz)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/editor-default-content/#post-15118907)
 * I’ve yet to find a PHP method of inserting default content like we did before.
   We may need to rely upon JavaScript or jQuery to insert default content into 
   the appropriate editor element after the editor has loaded. There will likely
   be a small delay between the editor appearing and the default content appearing.
 *  Thread Starter [anafasia](https://wordpress.org/support/users/anafasia/)
 * (@anafasia)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/editor-default-content/#post-15118912)
 * so I assume there’s no easy way to solve that, am I wrong?
    -  This reply was modified 4 years, 6 months ago by [anafasia](https://wordpress.org/support/users/anafasia/).

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

The topic ‘editor default content’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [anafasia](https://wordpress.org/support/users/anafasia/)
 * Last activity: [4 years, 6 months ago](https://wordpress.org/support/topic/editor-default-content/#post-15118912)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
