To stop xml-rpc from your cPanel you need to do following steps.
Step 1: Login to your cPanel.
Step 2: Scroll down to the Files section then click on “File Manager”.
Step 3: Click on “public_html” folder at the left side bar. A list of files and folder will be open.
Step 4: Navigate to .htaccess file from the list of files & folders and then click on “Edit” button at top navigation bar.
Step 5: Now a text editor will open. Click on “Edit” button in text editor as shown in the screenshot.
Step 6: After that you need to enter the following code at the last in the .htaccess file to stop xml_rpc permanently:
Step 7: Now click on “Save” button at the top right side then click on “Close” button.