BuddyX

13 min read · 2,505 words

How to Hide LearnPress Course Buttons Using the BuddyX Theme

Hide LearnPress Course Buttons

LearnPress is a capable Learning Management System plugin for WordPress, handling course creation, user management, and payment options out of the box. But its default interface does not always fit every site. One recurring request from site owners is getting rid of the built-in course buttons, “Buy Now” or “Take This Course”, that LearnPress shows automatically on every course page.

If you’re running the BuddyX theme, a responsive theme built for community and learning platforms, hiding or replacing these buttons is genuinely straightforward. Whether you’re running a course marketplace, a social learning platform, or a private training site with its own enrollment process, BuddyX gives you several ways to adjust this without fighting the plugin. This guide walks through each method, from a quick CSS override to a full child theme customization.

None of these approaches require deep WordPress development experience. The CSS route takes under five minutes for anyone comfortable pasting a code snippet into the Customizer, and even the child theme approach, the most involved option here, follows a repeatable pattern once you have done it once. Pick the method that matches both your comfort level and how permanent you want the change to be, since some approaches are easier to reverse than others.

Why Hide LearnPress Course Buttons?

A few concrete situations come up often enough to be worth covering before the how-to steps.

1. A Cleaner Learning Interface

Some course platforms work better without extra buttons cluttering the page. Removing anything that is not the content itself keeps a learner focused on what they came to do.

2. A Different Enrollment Process

Corporate training sites often handle enrollment offline, through an approval process or a direct sales conversation rather than a self-serve checkout. Hiding “Enroll Now” keeps the page consistent with how enrollment actually happens on that specific site.

3. A Custom Call to Action

Some sites would rather send a visitor to a contact form or an inquiry page instead of a generic purchase button, particularly for higher-priced or consultative course sales where a direct checkout does not fit the sales process.

Methods to Hide LearnPress Course Buttons in BuddyX

Method 1: Custom CSS in the WordPress Customizer

The fastest option requires no file editing at all. BuddyX supports adding custom CSS directly through the WordPress Customizer, and a single rule is enough to hide the buttons globally.

Steps:

  1. Log in to your WordPress dashboard.
  2. Go to Appearance > Customize.
  3. Navigate to Additional CSS.
  4. Add the following CSS code:
.learn-press-course-buttons { display: none !important; }
  1. Click Publish to save your changes.

This rule hides all LearnPress course buttons sitewide. If you only want to hide buttons on specific courses, target the specific course ID or a course-level CSS class instead of the general selector above.

Method 2: BuddyX Child Theme Customization

For more control, a child theme lets you modify LearnPress template files directly without touching BuddyX’s core files, which means your changes survive theme updates cleanly.

Steps:

  1. Create a child theme. Create a folder named buddyx-child inside wp-content/themes/, then add a style.css and a functions.php file to that folder.
  2. Copy the relevant LearnPress template. Find the templates inside the LearnPress plugin folder, typically wp-content/plugins/learnpress/templates/, and copy single-course.php into buddyx-child/learnpress/single-course.php.
  3. Locate and modify the button code. Open the copied template file and find the section that outputs the course buttons. It typically looks like this:
do_action('learn-press/before-course-buttons');

Comment it out to hide the buttons:

// do_action('learn-press/before-course-buttons');
  1. Activate the child theme. Go to Appearance > Themes in the WordPress dashboard and activate the BuddyX child theme you just created.

This approach keeps your customization intact even after LearnPress or BuddyX pushes an update, since you are editing a copy of the template rather than the original file.

Also Read: Best KPI Software for Tracking Performance

Method 3: Plugins for CSS and Code Management

If editing CSS or PHP directly is not something you want to do by hand, a plugin can handle it for you:

  • CSS Hero offers a visual point-and-click interface for customizing styles. Select the course buttons directly on the page and set their display property to none, no code required.
  • Custom CSS & JS plugins give you a dedicated place to paste CSS or JavaScript snippets, including the same rule shown in Method 1, without touching the Customizer.
  • Code Snippets plugins are the right tool if you need to add a PHP-based fix instead, letting you manage snippets from the dashboard without editing theme files directly.

Method 4: BuddyX Theme Options

Depending on your BuddyX version, the theme may include a built-in setting for this:

  1. Navigate to BuddyX Options in the WordPress dashboard.
  2. Look for a LearnPress Integration section.
  3. Toggle course button visibility off if the option is available in your version.

Not every BuddyX release includes this toggle, so if you do not see it, Method 1 or Method 2 will get you the same result.

Replacing Course Buttons Instead of Just Hiding Them

If the goal is a different call to action rather than no call to action at all, a few options handle that cleanly:

  • Custom HTML widgets let you swap in a contact form or inquiry button using a shortcode, in the same spot where the default course button used to sit.
  • Third-party form plugins like WPForms or Gravity Forms are a common choice for building that replacement CTA, since both integrate cleanly with a WordPress theme and support the shortcode approach.
  • LearnPress hooks give developers a way to inject custom content in the exact spot the default buttons occupied, which is the cleanest approach if you want the replacement to inherit the same layout and spacing as the original.

Why BuddyX Works Well for LearnPress Customization

BuddyX was built with community and eLearning platforms specifically in mind, which is why customizations like this tend to go smoothly compared to forcing a generic theme to support LearnPress.

LearnPress compatibility. BuddyX integrates cleanly with LearnPress’s markup and hooks, which is why the CSS selectors and template paths in this guide work without extra workarounds.

Social learning features. Paired with BuddyPress, BuddyX supports forums, member profiles, and activity streams alongside your courses, turning a standalone LMS into something closer to a full learning community.

Responsive design. The theme adapts across devices without extra configuration, so a course page looks right on a phone the same way it does on a desktop.

Customizable options. From styling controls to feature toggles, BuddyX gives you room to tailor the site to a specific enrollment workflow rather than accepting the LearnPress defaults as-is.

Testing Your Changes Before Going Live

Whichever method you use, check the result across a few different course pages before considering the job done, not just the one course you were originally troubleshooting. A CSS rule that works cleanly on a standard course page can behave differently on a course with a different pricing structure or enrollment type, since LearnPress renders slightly different button sets depending on course configuration.

It is also worth checking the change on mobile specifically. A button hidden via CSS on desktop should stay hidden on mobile too, but a template-level change made in Method 2 sometimes needs a second look at how the surrounding layout reflows once the button is gone, particularly if the button previously anchored other elements around it.

Common Mistakes to Avoid

Editing the original LearnPress plugin files directly, rather than working through a child theme or CSS override, is the most common mistake. Any direct plugin edit gets wiped out the next time LearnPress updates, silently undoing your customization until you notice the buttons are back.

Using an overly broad CSS selector is the second common issue. A rule aimed at hiding buttons on one specific course can accidentally hit every course on the site if the selector is not scoped tightly enough, which is worth double-checking with your browser’s inspector before publishing the change sitewide.

Choosing the Right Method for Your Situation

Method 1, the CSS override, is the right call for most site owners. It takes two minutes, requires no file access beyond the Customizer, and reverses cleanly if you change your mind later, just delete the CSS rule. Reach for it first unless you have a specific reason not to.

Method 2, the child theme, makes sense once you need more than a visual hide, like actually removing the button’s markup from the page rather than just hiding it with CSS, or replacing it with different content in the same template location. It takes longer to set up but gives you full control over the template output, not just its visibility.

Method 3 is worth it if you are not comfortable editing CSS or PHP directly and would rather work through a plugin interface. It adds a dependency to your site, one more plugin to keep updated, so weigh that against how often you expect to need this kind of customization going forward.

Method 4 is the easiest option when it is actually available, since it requires no code and no plugin at all, but not every BuddyX version ships with a built-in toggle for this, so check before planning around it.

Troubleshooting Common Problems

If the CSS rule from Method 1 does not seem to work, the most common cause is a caching plugin serving a stale version of the page. Clear your site’s cache after publishing the CSS change, and check for a CDN-level cache as well if your host uses one, since that can hold onto the old stylesheet even after WordPress itself has updated.

If buttons reappear after a LearnPress or BuddyX update, that almost always means the change was made by editing a plugin or parent theme file directly instead of through the Customizer or a child theme. Direct edits to plugin files get overwritten on update by design, which is exactly why Methods 1 and 2 are structured the way they are, to survive updates instead of getting wiped out by them.

If the child theme approach from Method 2 causes a fatal error or a blank page after activation, double-check that the style.css file includes the required theme header comment with a Template: line pointing to the parent BuddyX theme’s folder name. A missing or incorrect header is the most common reason a child theme fails to activate properly.

Extending This Approach to Other LearnPress Elements

The same techniques covered here apply well beyond just the buy and enroll buttons. Course progress bars, instructor bios, related course widgets, and review sections all follow the same basic pattern, a CSS class you can target directly, or a template file you can copy into a child theme and edit.

Before customizing a new element, inspect it in your browser’s developer tools first to find the exact class or ID LearnPress assigns it, rather than guessing based on similar elements elsewhere on the page. LearnPress is generally consistent with its class naming, but confirming the actual selector before writing CSS saves a round of trial and error.

Frequently Asked Questions

Will hiding course buttons with CSS affect LearnPress functionality?

No. A CSS display: none rule only affects visual rendering, not the underlying functionality. The button still exists in the page’s markup and LearnPress’s logic still runs normally; it simply is not visible to visitors. This is why Method 1 is safe to use even if you are not fully sure you want the change to be permanent.

Can I hide buttons on some courses but not others?

Yes. Instead of the global selector shown in Method 1, target a specific course using its post ID, for example by prefixing the rule with .postid-123, or by adding a custom CSS class to individual courses through LearnPress’s course editor and targeting that class specifically.

Does this work the same way with BuddyBoss instead of BuddyX?

The core LearnPress CSS classes and hooks stay the same regardless of which BuddyPress-compatible theme you run, since they come from the LearnPress plugin itself rather than the theme. The main difference is how cleanly each theme’s own styles interact with LearnPress’s markup, and BuddyX is built with that compatibility specifically in mind.

What if I want to hide buttons only for logged-out visitors?

That requires a small PHP snippet rather than pure CSS, since CSS cannot check a user’s login status. A Code Snippets plugin is the right tool here, using a conditional check like is_user_logged_in() around the button output, which is a good example of when Method 3’s PHP-focused option becomes necessary instead of a CSS-only fix.

Will these changes break if I switch away from LearnPress to a different LMS plugin later?

Yes, and that is worth planning for. CSS rules targeting LearnPress-specific class names will simply have no effect once those classes no longer exist on the page, which is harmless but also means the customization silently stops working rather than throwing an error. A child theme template copy tied to LearnPress’s specific template structure would need to be rebuilt entirely for a different LMS plugin, since template file names and hook structures vary significantly between LMS plugins.

Reversing the Change Later

Plans change, and it is worth knowing upfront how easy each method is to undo. Method 1 reverses instantly, just delete the CSS rule from Additional CSS and the buttons reappear on the next page load, no cache clearing beyond what you already needed for the original change. Method 4 is nearly as simple, just toggle the setting back if it exists in your BuddyX version.

Method 2 takes a bit more effort to reverse, since you would either need to restore the original do_action call in your child theme’s copy of the template, or deactivate the child theme entirely and switch back to the parent BuddyX theme, which also reverts any other customizations you made through the child theme in the meantime. Method 3 depends on the specific plugin, but generally reverses by deactivating the plugin or removing the snippet you added through it.

Keeping a note of exactly what you changed and where, even a simple comment in your CSS or a line in a private documentation file, saves real time if you or someone else on your team needs to reverse or adjust the customization months later and cannot immediately remember which of the four methods was used.

Making LearnPress Fit Your Site, Not the Other Way Around

Hiding LearnPress course buttons can genuinely improve both the usability and the look of an eLearning platform. With the BuddyX theme, you have a real range of options, from a one-line CSS tweak to a full template customization, to get there. Whether the goal is a simpler interface, a workflow that matches an offline enrollment process, or a custom CTA built around your own sales process, BuddyX gives you the tools to make it happen without fighting the plugin’s defaults.


Interesting Reads:

How to Keep Your BuddyPress Community Safe with Content Filters

How to build connections with new members in BuddyPress?

Bridge the Gap Between Members and Non-members with BuddyPress Contact Form

Reading
13 min · 2,505 words
Published
Nov 29, 2024
Shashank Dubey
BuddyX contributor

Writing about WordPress communities, BuddyPress, BuddyBoss, LMS plugins, and the business of paid communities.

Keep reading

More from the BuddyX blog

Browse all posts on community, WordPress, BuddyPress and the studio of plugins behind BuddyX.