I want to execute wp-cli command but it removes <script> tag

sudo runuser -l  userName -c 'wp widget add custom_html footer-1 1 --title="" --content="<script>alert(123);</script>" --path="/var/www/userName/data/www/mysite.abc"'

CentOS 7

After executing in created widget I get only alert(123); I tried to put it in single quotes, add backslashes and even urlencode() but not successful.

migrated from wordpress.stackexchange.com Oct 7 '18 at 12:12

This question came from our site for WordPress developers and administrators.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.