If you often add the same introductory or closing text to your blog posts, you can automate this process by inserting default text into the WordPress editor. On ruachost.com, this can be achieved by adding a simple PHP function to your theme.

 

Why Add Default Text?

  • Saves time by avoiding repetitive typing.

  • Ensures consistency across all blog posts.

  • Useful for adding standard disclaimers, calls to action, or promotional text.

 

Steps to Add Default Text

  1. Log in to WordPress with an administrator account.

  2. In the dashboard, go to Appearance → Theme Editor.

  3. Select your active theme and open the functions.php file.

  4. Add the following code snippet:

    // Add default text to new blog posts
    add_filter('default_content', 'ruachost_default_post_content');
    
    function ruachost_default_post_content($content) {
        $content = "If you enjoyed this post, please share it on social media!";
        return $content;
    }
    
  5. Save the file.

  6. Create a new blog post → The editor will automatically include the default text.

 

Important Notes

  • This only applies to new posts created after adding the code.

  • Existing posts will not be affected.

  • Always back up your theme before editing functions.php.

  • Use a child theme to preserve changes during updates.

Was this answer helpful? 0 Users Found This Useful (0 Votes)

Powered by WHMCompleteSolution