Beginner's Guide for WordPress - Start your WordPress Blog in minutes.
Choosing the Best
WordPress Hosting
How to Easily
Install WordPress
Recommended
WordPress Plugins
View all Guides

How to Add WordPress Widgets in Post and Page Content

Last updated on by
Follow WPBeginner on YouTube
How to Add WordPress Widgets in Post and Page Content

Widgets make it easy for users to simply drag and drop items into their WordPress site. Even though you can extend the power of default WordPress widgets, they are still limited to widget ready areas in your theme such as sidebars and footers. Wouldn’t it be nice if you could add widgets in your post or page content without writing a single line of code? Well, in this article, we will show you how to add WordPress widgets in posts and pages.

First thing you need to do is install and activate amr shortcode any widget. Once you activate the plugin, go to Appearance » Widgets. Next, drag and drop the widgets you want to display in your post or page into the Shortcodes sidebar.

Adding WorPress widgets in post or page content

Now those widgets are ready to be added to your content. Go to the post or page edit screen, and paste the following shortcode wherever you like in your content: [do_widget widgetname]. For example:

[do_widget calendar]

[do_widget pages]

If the widget name has space in it, then you need to add widget name in quotes like this:

[do_widget "recent posts"]

That’s it. Now you can add WordPress widgets in your post and page content. If you want to add a little more style to your widgets, then you might want to check out our article on how to make WordPress widgets colorful and less boring. Most widgets have titles, but if you don’t want to display them, then use this tutorial on how to hide widget titles.

Troubleshooting

If the widget does not show up in your content, then you need to use the widget id in the shortcode. First, make sure that you have added the right widget in the shortcodes sidebar, and you have added the shortcode with the widget name in your post or page. Publish that post/page and open it in a new browser window. Add the following string at the end of the page URL like this:

http://www.example.com/page-title/?do_widget_debug

It will show you debug information with widget IDs. Look for widget ids under the Shortcodes Sidebar.

We hope that this article helped you add widgets into your WordPress posts or pages. For questions and feedback please leave a comment or tweet at us by following @wpbeginner.


Editorial Staff at WPBeginner is a team of WordPress experts led by Syed Balkhi. Page maintained by Syed Balkhi.

WPBeginner's Video Icon
Our HD-Quality tutorial videos for WordPress Beginners will teach you how to use WordPress to create and manage your own website in about an hour. Get started now »

Comments

  1. Jeffrey Beckers says:

    Hi,

    I’m using your plugin to show the widget of recent topics. But the shortcode isn’t generating in the widget.

  2. Gopi says:

    This is an amazing plugin. Is there an way to change the design of the plugin

  3. Louis says:

    Hi, this is a great plugin. Thank you for it.
    Is there a way to change the styles on the widget in the AMR without it affecting the widgets throughout the rest of the site? Mainly I’m concerned with the padding of 20% which centers the content awkwardly on my page. If I change it to 0% in the .widget css it looks great but the widgets on the other pages are all messed up. Is there a way to apply separate CSS to the AMR content without it affecting the other widgets?

  4. Mackenzie says:

    Thank you for this, it works great in the content of one of my pages. However, it doesn’t seem to work on my homepage. The homepage edit area IS different since I have to go to theme options>appearance instead of the individual page…Wordpress just gives me a place to add text, although I use HTML there for other things that seem to work fine. I tried adding the shortcode to the “home” edit page also with no luck.

    Another page on this site said to add the following to functions.php in my child theme:
    add_filter(‘widget_text’, ‘do_shortcode’);

    But just adding that doesn’t help either. There must be some setting with the homepage that won’t allow this. Any ideas? Thanks

  5. Coach Maria says:

    Would this work to put content at the bottom of each post? (Like a subscription form?)

  6. Sudhakar Goverdhanam says:

    It worked fine, Thanks

  7. Zaheer Abbas says:

    Thank u …. Newsletter plugin now working in pages and posts as well as it works only in right sidebar

  8. gmanob says:

    I downloaded and activated this plugin then I go to Appearance – Widgets but cannot find Shortcode. Any ideas? Thanks!

  9. Andrea Valgoi says:

    Hello, I have this problem. The widget on a specific page (which works perfectly) overlaps the menus if i scroll down.

    Any ideas how to solve it?

  10. Yuriy says:

    Awesome! Thank you! Great plugin! It completely meet my expectations!

  11. Asad Iqbal says:

    Its a pleasure for me to use this plugin.Very nice approach .

    Thanks .

  12. Tom says:

    Thanks! This worked.

  13. Nicole @ The Pixel Boutique says:

    Thank you! Just what I needed to make a separate page for Jetpack subscription signup. Great plugin I’ll use often. :)

  14. anand kumar says:

    how i get short codes for php/text widgets .
    this plugins is not showing any thing for these

  15. Jessi says:

    This plugin is perfect! I have a question though: How does one align the widget to the left of the post with the text wrapping around it? What is the exact CSS code that needs to be used?

  16. Shonda says:

    Love your widget. However, how do you edit a widget to be able to use it on more than one post with different data? For instance, the widget I am using ask what category and how many post in that category I want to display.

    As it stands, I have to edit the widget in the short code area, then I can place it in one page. Now I want to add the widget to two other pages with a different category and # of posts. Thanks in advance.

    • WPBeginner Support says:

      you can add multiple widgets by dragging them into shortcodes sidebar on the widgets screen and using the widget id to display it in the post.

      • Paul says:

        Thanks a lot for this plugin !! Me too I would like to post the same widget in different pages but where do you find the widget id ?

  17. Sameer Verma says:

    Hi,

    Is there anyway to display the widget id in all post. I want to display a widget below post in all type of posts .

    Actually i need a share this site below to all posts and pages .
    How i can??

  18. rianne says:

    Hey! I added the widget in the main sidebarthing at the widget page and put the code in the page. I see the widget, wich is really cool, but i also see this message:

    Sidebar Shortcodeswith sidebarid Shortcodes empty or not defined.
    Widget dooodl! not in sidebar with id Shortcodes and with name Shortcodes

    How can i delete that? And why is it there?
    thanks! greetings

    • WPBeginner Support says:

      The widget you want to display on the page, you need to drag and drop that widget to the shortcodes sidebar first. Then use the shortcode in a page to display the widget.

  19. Krishna veni says:

    Hi,

    Is there anyway to display the widget id in all post. I want to display a widget below post title in all post

    Regards
    Krishna Veni

  20. Cindy tucker says:

    Help! I want to place a subscription widget under each post and I don’t know any code. How do I do this?

  21. Flame Denise says:

    How about if mw widget is a Text with a title “Our Services”?
    All these shortcodes don’t work:

    [do_widget Text: Our Services]
    [do_widget Text:Our Services]
    [do_widget “Text: Our Services”]

    • Alexander Bradley says:

      Don’t know why the writer didn’t get back to you. I had the same issue but found that the title for the Widget is just called Text. Try that and see if it works. Not sure what happens if you have multiple widgets called Text but I guess I see soon enough.

  22. Daniel Nielsen says:

    Hi

    What to call it if you wanner use the same widget more then one time in one page:

    [do_widget count down]
    &
    [do_widget count down]

  23. Ashish says:

    for example
    [do_widget “recent posts”] this one
    how can i align it in such a way that it appears with a specific height and width
    aligned to the right side of the post or in the middle of the post with the text surrounding it ?
    Is it possible ?

  24. Sarah says:

    Is this missing any steps? I’ve tried the debug and it still doesn’t work. When I debug, I get a very generic name for the widget “text-4”.

    Is there a way to set the widget I’d manually?

    Is there a problem with the amr shortcode widget plugin? Eg is this still the plugin to use as of aug 2013?

    • Aistis says:

      Either the plugin has updated or this tutorial was incorrect to begin with.

      Use [do_widget id=recent-posts-2] or [do_widget “Recently in news”]

      • WPBeginner Support says:

        The tutorial is correct, we double checked it and you are doing exactly what we showed in the tutorial above.

  25. Prashant Ghai says:

    This is an amazing tip. My blog has a single column theme and this is just the kind of thing i needed. Thanks a lot.

Add a Comment

We're glad you have chosen to leave a comment. Please keep in mind that all comments are moderated according to our comment policy, and all links are nofollow. Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.