16 min read

How to use LearnDash Shortcodes

Shashank Dubey
Content & Marketing, Wbcom Designs · Published May 7, 2024 · Updated Mar 27, 2026
How to use LearnDash Shortcodes


LearnDash shortcodes let you display course content, enrollment buttons, progress bars, and user-specific information anywhere on your WordPress site – not just on the standard LearnDash template pages. This complete 2026 guide covers every major LearnDash shortcode, its parameters, practical examples of when to use each one, and how to combine shortcodes to build powerful custom student experiences without any custom PHP code.


Why Use LearnDash Shortcodes?

LearnDash creates its own template pages for course listings, lesson content, quizzes, and student profiles. These pages work well for standard installations but limit where you can display course-related information. Many course sites need to go beyond these defaults: a homepage that shows enrolled courses to logged-in students and a course catalog to guests, a landing page with a dynamic enrollment button that changes based on whether someone is already enrolled, a member dashboard showing progress across multiple courses, or a blog post that promotes a specific course with current enrollment status displayed.

Shortcodes make all of this possible without custom PHP code. They are the most accessible tool for extending LearnDash beyond its default templates – no developer required.

In the Gutenberg block editor, shortcodes are inserted using the Shortcode block (search for “shortcode” in the block inserter). In Classic Editor, paste them directly in the text. Page builders like Elementor, Beaver Builder, and Divi all have shortcode widgets or modules. LearnDash 4.x also offers native Gutenberg blocks for many of these functions – more on that later.

Shortcodes are the bridge between LearnDash’s default templates and the custom course experience your students actually need.


Course Display Shortcodes

[ld_course_list] – Display a List or Grid of Courses

This is the most commonly used LearnDash shortcode. It displays your courses anywhere on the site in a configurable grid or list format. Basic usage with no parameters: [ld_course_list] displays all published courses using the default layout.

The shortcode accepts extensive parameters to filter, sort, and display courses in exactly the format you need:

Parameter Values Default Example
num Any number, or -1 for all -1 (all) num=”6″
course_id Comma-separated course IDs None (all courses) course_id=”123,456,789″
orderby date, title, ID, rand, menu_order date orderby=”title”
order ASC, DESC DESC order=”ASC”
category_name Category slug None (all categories) category_name=”marketing”
cat Category ID None cat=”12″
tag Tag slug None tag=”beginner”
enrolled true/false false (all courses) enrolled=”true”
status not-started, in-progress, completed All statuses status=”completed”
col 1, 2, 3 3 col=”2″
thumbnail true/false true thumbnail=”false”
paged true/false false paged=”true”
price_type free, paynow, subscribe, closed All types price_type=”free”
show_content true/false false show_content=”true”

Practical Examples

Show 6 marketing courses in 3 columns, newest first:
[ld_course_list num="6" category_name="marketing" orderby="date" order="DESC" col="3"]

Show all free courses alphabetically:
[ld_course_list price_type="free" orderby="title" order="ASC" num="-1"]

Show a random selection of 3 courses (good for homepage teasers):
[ld_course_list num="3" orderby="rand" col="3"]

Show only courses the current user is enrolled in:
[ld_course_list enrolled="true" num="-1" col="2"]

Show only courses the current user has NOT started (good for upsell sections):
[ld_course_list enrolled="false" num="6" orderby="rand"]


Enrollment and Access Shortcodes

[learndash_course_enroll] – Enrollment Button

Displays an enrollment button for a specific course. Useful for custom landing pages where you want to place the “Enroll Now” button at specific locations in your page layout rather than using the default LearnDash template’s button position.

Basic usage: [learndash_course_enroll course_id="COURSE_ID"]

Replace COURSE_ID with the actual post ID of your LearnDash course. Find the course ID by editing the course in WordPress – the ID appears in the URL as “post=XXXX.” The button shows “Enroll” to non-enrolled users and redirects to the course content for enrolled users. If the course has a WooCommerce product linked, the button directs to the WooCommerce product page for purchase.

[learndash_login] – Inline Login Form

Displays a login form inline on any page. The form redirects users to the course page after successful login. This is particularly useful on course landing pages where you want to convert visitors who already have accounts without sending them away to a separate login page.

Usage: [learndash_login]

Parameters:

  • login_url – Custom redirect URL after successful login (default: current page)
  • registration_url – Custom URL for the registration link shown to non-members
  • preview_button – “yes” or “no” – whether to show a preview button for guest users

[learndash_register] – Registration Form

Displays a registration form that creates a new WordPress user account and optionally enrolls them in a specific course. Combined with [learndash_login], you can create a complete member area on any page with both login and registration forms without sending users to the default WordPress login page.

Usage: [learndash_register]


Progress and Status Shortcodes

[ld_course_progress] – Course Progress Bar

Displays a progress bar showing the current user’s completion percentage for a specific course. Ideal for member dashboard pages, profile pages, or course landing pages that enrolled students also use.

Usage: [ld_course_progress course_id="COURSE_ID"]

Omit the course_id to automatically show progress for the course the user is currently viewing (useful inside course template overrides).

The progress bar displays as a percentage complete and shows zero for users who have not started the course. For non-enrolled users, the shortcode typically renders nothing – which is the correct behavior (you would not want non-enrolled users seeing a 0% progress bar that implies they should have started).

[learndash_user_status] – User Course Status

Shows whether the current user is not enrolled, enrolled and in progress, or completed for a specific course. This is a display shortcode – it shows status text, not action buttons. Use it alongside the enrollment shortcode to provide full context on a course page.

Usage: [learndash_user_status course_id="COURSE_ID"]

[learndash_course_points] – User Points Display

Displays the current user’s total course points. Useful in gamified learning environments where points are used for leaderboards, certificates, or unlocking content. Works alongside LearnDash’s built-in course points feature.

Usage: [learndash_course_points]


Content Gating Shortcodes

Content gating shortcodes show or hide content based on a user’s enrollment and completion status. These are wrapper shortcodes – content placed inside them displays only to users in the specified state.

[learndash_course_complete] – Show Content to Completers Only

Wraps content that only appears to users who have fully completed a specific course. Use this for unlocking bonus content, displaying certificate download links, showing testimonial requests, or revealing access to a private community group after course completion.

Usage:
[learndash_course_complete course_id="COURSE_ID"]
Your exclusive post-completion content here.
[/learndash_course_complete]

[learndash_course_inprogress] – Show Content to Active Students

Shows content only to users who are enrolled and have started but not yet completed the course. Use this for “Continue Learning” calls to action, progress-specific encouragement messages, or mid-course bonus resources.

Usage:
[learndash_course_inprogress course_id="COURSE_ID"]
You are making great progress! Here are some additional resources for where you are in the course.
[/learndash_course_inprogress]

[learndash_course_notstarted] – Show Content to Non-Started Enrolled Users

Shows content to users who are enrolled but have not yet started the course (enrolled but 0% progress). Useful for showing a “Get Started” CTA with direct links to the first lesson, reducing the friction between enrollment and first lesson access.

[learndash_course_expired] – Show Content to Users with Expired Access

For courses with access expiry configured in LearnDash, this shortcode shows content to users whose access has expired. Use it to display a renewal offer, a re-enrollment button, or an upgrade prompt. This is the shortcode that powers your re-enrollment revenue flow for time-limited course access.

Usage:
[learndash_course_expired course_id="COURSE_ID"]
Your access to this course has expired. Renew now for full lifetime access: [enrollment button]
[/learndash_course_expired]


Quiz and Assessment Shortcodes

[ldadvquiz] – Display a Specific Quiz

Embeds a specific LearnDash quiz anywhere on your site. This is useful for lead generation quizzes (offer a free diagnostic quiz as a landing page), pre-course assessments on sales pages, or embedding knowledge checks in blog posts related to your course topic.

Usage: [ldadvquiz 123] where 123 is the quiz post ID.

Find the quiz ID by editing the quiz in LearnDash and checking the URL for the “post=” parameter. The quiz renders with its full configuration – time limits, pass requirements, and result display all apply exactly as configured in the quiz settings.

[learndash_quiz_list] – List All Quizzes

Displays a list of quizzes with optional filtering by course or category. Useful for assessment-heavy learning platforms where students need to find and retake quizzes for certification, or where multiple quizzes exist across a course series.

Parameters: course_id (filter by specific course), orderby (date, title, ID), order (ASC, DESC), num (maximum number to show).


Group and Team Shortcodes

[learndash_group_list] – Display Groups

LearnDash Groups let you batch-enroll users into courses – particularly valuable for corporate training where you sell to organizations rather than individuals. This shortcode displays the groups the current logged-in user belongs to, useful on student dashboard pages where employees can see their assigned training groups.

Usage: [learndash_group_list]

[learndash_group_user_list] – List Users in a Group

For group leaders and managers, this shortcode displays the list of users in a specific LearnDash group. Useful on team dashboards where managers need to see who is in their team’s training group and track which members are active.

Usage: [learndash_group_user_list group_id="GROUP_ID"]


Using LearnDash Shortcodes in Gutenberg

In the WordPress block editor, add a “Shortcode” block by clicking the + icon, searching for “Shortcode,” and selecting it. Paste your shortcode into the block. Shortcode output is not previewed in the editor itself – you see the raw shortcode text in the editor. Use the “Preview” button (top right) or view the published page to see the rendered output.

An important note about LearnDash 4.x: many shortcode functions are now also available as native Gutenberg blocks under the “LearnDash” category in the block inserter. These native blocks provide a visual interface in the editor – you select options via dropdowns rather than typing shortcode parameters. Where a native block exists for a function you need, using the native block is generally preferable because you get a visual configuration interface and can see what the block will output without always relying on preview.

Shortcode Native Block Available in LD 4.x
[ld_course_list] Yes – “LD Course List” block
[learndash_course_enroll] Yes – “LD Course Enroll” block
[ld_course_progress] Yes – “LD Course Progress” block
[ldadvquiz] Partial – available as embed
[learndash_course_complete] Yes – conditional blocks
[learndash_group_list] No – shortcode only

Practical Shortcode Combinations for Common Use Cases

Custom Student Dashboard Page

Create a custom “My Learning” dashboard page that shows enrolled courses, overall progress, and recommendations for next steps. Structure this page using a combination of shortcodes and standard Gutenberg content blocks:

Section 1 – “Your Courses” heading, then:
[ld_course_list enrolled="true" num="-1" col="2" paged="true"]

Section 2 – “Your Completed Courses” heading, then:
[ld_course_list enrolled="true" status="completed" col="3" num="6"]

Section 3 – “Explore More Courses” heading (shows courses not yet enrolled in), then:
[ld_course_list enrolled="false" num="6" orderby="rand" col="3"]

Course Landing Page with Conditional CTAs

A single course landing page that shows different calls to action based on enrollment status – showing enrollment options to non-students and progress information to enrolled students:

For non-enrolled visitors:
[learndash_course_notstarted course_id="123"]
[Your enrollment button or pricing section here]
[/learndash_course_notstarted]

For enrolled, in-progress students:
[learndash_course_inprogress course_id="123"]
[ld_course_progress course_id="123"]
[Link to continue the course]
[/learndash_course_inprogress]

For students who completed the course:
[learndash_course_complete course_id="123"]
Congratulations! You have completed this course. [Certificate download link] [Review request]
[/learndash_course_complete]

For users with expired access:
[learndash_course_expired course_id="123"]
Your access has expired. [Re-enrollment offer with discount]
[/learndash_course_expired]

Course Catalog Homepage Section

For a homepage section that shows relevant courses to both logged-in students and guest visitors, use two shortcodes in sequence with heading blocks separating them:

H2 heading: “Your Enrolled Courses” (this shows to logged-in users; guest users see nothing for enrolled courses, which is fine):
[ld_course_list enrolled="true" num="3" col="3"]

H2 heading: “Featured Courses”:
[ld_course_list num="6" orderby="rand" col="3"]

Lead Generation Quiz Page

Embed a LearnDash quiz on a landing page as a free diagnostic tool to capture leads and demonstrate course value:

H2 heading: “Test Your Knowledge – Free Assessment”
[ldadvquiz QUIZ_ID]
Below the quiz: A shortcode or text CTA pointing to the paid course where they can learn what the quiz tested.


Troubleshooting Common Shortcode Issues

Problem Likely Cause Solution
Shortcode displays as plain text (not rendered) Shortcode not registered or plugin not active Verify LearnDash is active; check for typos in shortcode name
Course list shows no courses Filter parameters too restrictive or no courses match Test with basic [ld_course_list] first, then add filters
Enrolled courses list shows wrong courses User is not logged in or wrong user account Test while logged in as the student account experiencing the issue
Progress bar shows 0% for enrolled student Student has not completed any lessons or quizzes Verify student has started at least one lesson; check course ID is correct
Conditional shortcode shows content to wrong users Course ID incorrect or enrollment status mismatch Verify course ID; check whether user is actually enrolled in that specific course
Quiz shortcode shows error Wrong quiz ID or quiz not published Edit the quiz in LearnDash, check the URL for the post ID, verify quiz is published

Shortcodes with Page Builders

Elementor Integration

Elementor has a native “Shortcode” widget in both the free and Pro versions. Drag the Shortcode widget to your layout, paste your LearnDash shortcode, and it renders in the Elementor canvas. For responsive design with shortcode output, wrap the Shortcode widget in an Elementor Column with appropriate width settings.

LearnDash and Elementor also have a dedicated integration via the LearnDash for Elementor plugin – this adds LearnDash-specific widgets to the Elementor widget panel, providing a visual interface for course-related content blocks without needing to write shortcodes manually.

Beaver Builder and Divi

Both Beaver Builder and Divi have shortcode modules that work identically to Elementor’s shortcode widget. Paste the shortcode into the module and it renders in the layout. These page builders do not have dedicated LearnDash modules (unlike Elementor), so shortcodes remain the primary integration method for them.


Beyond Shortcodes: Native LearnDash Blocks

LearnDash 4.x introduced native Gutenberg blocks that replace many shortcodes for users on the block editor. Navigate to any page or post in Gutenberg, click the + block inserter, and search for “LearnDash” or scroll to the LearnDash category. The native blocks include Course List, Course Progress, Course Enroll, Video Progression, and Conditional content blocks.

For new pages you are building from scratch, native blocks are preferable because they provide a visual configuration interface in the editor, they are maintained by the LearnDash team alongside the core plugin, and they render the same output as the equivalent shortcodes. Shortcodes remain valuable for: existing pages that were built before native blocks existed, page builders that do not support Gutenberg blocks natively, and for any shortcode that does not have a native block equivalent yet.


Performance Considerations for LearnDash Shortcodes

Shortcodes that query course data generate database queries on every page load where they appear. For most sites this is not an issue, but as your course catalog grows and your student count increases, poorly configured shortcodes can slow down pages noticeably.

Limiting Query Scope

The [ld_course_list] shortcode with num="-1" on a high-traffic page fetches every course in your database on every page load. On a site with 20 courses this is fine. On a site with 500 courses, this creates a measurably slow query. Use the num parameter to limit results to what actually fits in your layout – if you are showing a 3-column grid of courses, showing more than 9-12 at a time rarely helps users and always costs query overhead. Add paged="true" if you want students to be able to browse additional courses.

For enrolled course lists, the query scope is naturally narrowed to the current user’s enrolled courses. This query stays fast even as your total course count grows because it filters by user enrollment rather than scanning all courses. Enrolled course shortcodes are generally safe to use without num restrictions.

Caching Shortcode Output

Page-level caching (WP Rocket, WP Super Cache) does not help with shortcodes that show user-specific content – cached pages cannot show per-user enrollment status or progress bars. These pages must be excluded from page cache. However, pages that show only the public course catalog (no user-specific data) can and should be page-cached.

For student dashboard pages that must stay uncached because they contain user-specific shortcode output, make sure you have object caching (Redis or Memcached) configured at the server level. Object caching stores repeated database query results in memory so repeated requests for the same course data do not each hit the database, even when page caching is disabled for logged-in users.

Shortcode Placement Strategy for Speed

Placing multiple heavy shortcodes on a single page multiplies the database load for that page. A student dashboard page that simultaneously shows enrolled courses, completed courses, available courses, current points, and group status is generating 5+ separate database queries on every load. This is workable with good infrastructure, but review whether all that information genuinely needs to be on one page or whether splitting into tabs (which only load content for the active tab) would serve users equally well while reducing per-load query count.


Common Mistakes to Avoid with LearnDash Shortcodes

  • Using hardcoded course IDs that change between environments: If you develop on a staging site where your course ID is 45 and deploy to production where the same course has ID 312, every shortcode with a hardcoded course_id breaks. Document which courses map to which IDs in production and always verify shortcodes after migrating between environments.
  • Forgetting to test as a non-enrolled user: Conditional shortcodes like [learndash_course_complete] show nothing to non-enrolled users, which is correct – but developers testing while logged in as an admin with all courses enrolled never see the non-enrolled state. Always test your shortcode-based pages in an incognito window or a test account with no enrollments.
  • Nesting incompatible shortcodes: Wrapping one conditional shortcode inside another (for example, placing [learndash_course_inprogress] inside a [learndash_course_complete] block) creates logic conflicts that produce unpredictable output. Keep conditional shortcodes at the same level, not nested inside each other.
  • Using the shortcode on pages where LearnDash styles are not loaded: LearnDash enqueues its CSS on course-related pages automatically. On unrelated pages (a homepage, a blog post), the enrollment button or progress bar shortcode may render without proper styling. LearnDash provides a setting to load its CSS globally if you need shortcodes on arbitrary pages.

Frequently Asked Questions About LearnDash Shortcodes

Can I use LearnDash shortcodes in widget areas?

Yes. Add a Text or HTML widget to your sidebar or footer and paste LearnDash shortcodes into it. The shortcode will render wherever the widget appears. This is useful for sidebar enrollment CTAs or “Your Progress” widgets that appear across the site for logged-in students.

Do shortcodes slow down my site?

LearnDash shortcodes generate database queries on the pages where they appear. [ld_course_list] with no filters queries all courses – if you have hundreds of courses, this can be slow. Use the num parameter to limit results, and add caching (WP Rocket or similar) with appropriate page cache settings. Avoid using [ld_course_list] with num=”-1″ on high-traffic pages.

How do I find the correct course_id for a shortcode?

Edit the course in LearnDash (LearnDash LMS > Courses > Edit). The URL in your browser will show “post=XXXX” – that number is the course ID. Alternatively, hover over the course title in the course list and look at the URL in your browser’s status bar. For quizzes and lessons, the same method applies.

Can I combine multiple conditional shortcodes on the same page?

Yes – this is actually the intended use case. Using [learndash_course_notstarted], [learndash_course_inprogress], [learndash_course_complete], and [learndash_course_expired] together on a single course page creates a fully dynamic page that shows the right content to each user based on their current status. LearnDash evaluates each shortcode independently and shows only the content whose condition applies to the current user.

Why does my enrollment button shortcode redirect to the wrong page after login?

The redirect destination after login for the enrollment button is controlled by the redirect_url parameter in the shortcode (if supported) or by the LearnDash global login redirect settings (LearnDash > Settings > Registration & Login). If students are landing on the wrong page after enrolling or logging in, check both the shortcode parameters and the global LearnDash login settings. Also verify that the WooCommerce “My Account” redirect settings are not overriding LearnDash’s redirect for enrollment flows tied to WooCommerce products.


Extending LearnDash with Wbcom Designs Plugins

Beyond shortcodes, extending LearnDash with purpose-built plugins adds features that shortcodes cannot provide: custom student dashboards, BuddyPress social integration that shows learning progress in community profiles, group instructor management for corporate training platforms, and advanced reporting. Wbcom Designs has a LearnDash plugin collection built specifically to fill these gaps.

The BuddyPress-LearnDash integration from Wbcom Designs is particularly valuable for community-based learning platforms – it surfaces course enrollment, progress, and completion in member activity streams and profiles, creating social proof and peer accountability that increases course completion rates significantly compared to isolated individual learning experiences. For more tutorials, plugin reviews, and setup walkthroughs, visit our LearnDash guide.

Shashank Dubey
Content & Marketing, Wbcom Designs

Shashank Dubey, a contributor of Wbcom Designs is a blogger and a digital marketer. He writes articles associated with different niches such as WordPress, SEO, Marketing, CMS, Web Design, and Development, and many more.

Related reading