Question

How do I enable xml-rpc on Wordpress installed via marketplace?

Posted April 15, 2019 2.4k views
WordPressUbuntu 18.04

So the Wordpress xml-rpc is disabled by default for security reasons in the app installed via marketplace; that’s great. But I need it to post via the Wordpress app. Does anybody have a clue as to how to do this?

(I can’t find anything describing how it is blocked. I’m guessing .htaccess, but even if I try to - shortly - commenting out everything in there I still can’t call xml-rpc.php.)

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
4 answers

Hey friend,

To disable the xml-rpc.php block on our Wordpress one-click image, try these commands over SSH/console:

a2disconf block-xmlrpc
systemctl reload apache2

Jarland

That worked for me too. For testing purposes, what is the command to renable xml-rpc blocking?

Yep, that was it! Thanks a bunch. :)

Here is my process of debugging, and if you happen to run into similar situation

  1. Fix the XMLRPC problem of mywordpress.my.domain
    • I noticed that whenver I try to visit https://mywordpress.my.domain/xmlrpc.php it keeps redirect to https://mywordpress.my.domain/
    • Then I suspect it was because Apache2 rewrite
    • Found a way to print out Apache2 service logs tail -f /var/log/apache2/access.log
    • It yields
73.222.245.192 - - [23/Apr/2020:17:37:16 +0000] "GET /xmlrpc.php HTTP/1.1" 301 1112 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.113 Safari/537.36"
73.222.245.192 - - [23/Apr/2020:17:37:16 +0000] "GET / HTTP/1.1" 200 33054 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.113 Safari/537.36"
127.0.0.1 - - [23/Apr/2020:17:37:17 +0000] "POST /wp-cron.php?doing_wp_cron=1587663437.1659369468688964843750 HTTP/1.1" 200 4423 "https://mywordpress.my.domain/wp-cron.php?doing_wp_cron=1587663437.1659369468688964843750" "WordPress/5.3.2; https://mywordpress.my.domain"
73.222.245.192 - - [23/Apr/2020:17:37:17 +0000] "GET /wp-admin/admin.php?page=stats&noheader&proxy&chart=admin-bar-hours-scale HTTP/1.1" 200 558 "https://mywordpress.my.domain/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.113 Safari/537.36"
73.222.245.192 - - [23/Apr/2020:17:37:19 +0000] "POST /wp-admin/admin-ajax.php?_fs_blog_admin=true HTTP/1.1" 200 597 "https://mywordpress.my.domain/wp-admin/admin.php?page=wp-fail2ban" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.113 Safari/537.36"
  • it turns out the GET /xmlrpc.php HTTP/1.1" 301 1112 keep redirecting to 301 (HTTP code for permenantly moved). And I checked the config and it turns out there is a block-xmlrpc.conf
  • and I found https://www.digitalocean.com/community/questions/how-do-i-enable-xml-rpc-on-wordpress-installed-via-marketplace which makes it even easier.
Submit an Answer