troubleshooting Question

How do I add a PayPal button to a WordPress site using the block editor?

Avatar of Lev Seltzer
Lev SeltzerFlag for Israel asked on
WordPressPayPal
7 Comments1 Solution15 ViewsLast Modified:
This seems like a ridiculous questions, but the obvious method is not working for me.My button code is as follows:
<form style="text-align: center;" action="https://www.paypal.com/cgi-bin/webscr" method="post"><input type="hidden" name="cmd" value="_s-xclick" />
<div class="wp-block-column"><!-- wp:html -->
<input type="hidden" name="hosted_button_id" value="S37XKJTFBJXT6" />    
<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif" border="0" name="submit" title="PayPal - The safer, easier way to pay online!" alt="Donate with PayPal button" />    
<img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1" />    
</form>

The page was a classic WordPress page, and I recently converted it to a block. I added a custom code block, pasted the PayPal code, previewed the page (it worked), saved the page, and then got the message

This block contains unexpected or invalid content.

What am I doing wrong? Or is there an easier way to have a simple PayPal donation button using the block editor?

Thank you.
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 1 Answer and 7 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 7 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros