How to get bulk actions handler to display simple “Hello World”?

The user is redirected away after the bulk action is performed, so any output will be on the page you’re quick redirected away from.

For example, if you’re bulk eiditng pages, you’ll start on a URL like:

http://example.com/wp-admin/edit.php?post_type=page&paged=1

Then you perform a bulk action. Once it’s done you’ll end up on:

http://example.com/wp-admin/edit.php?post_type=page&paged=1

The same page, but with a confirmation message. However, in between you’r browser will go to:

http://example.com/wp-admin/edit.php?s=&post_status=all&post_type=page&_wpnonce=06d56450b9&_wp_http_referer=%2Ftheme1%2Fwp-admin%2Fedit.php%3Fpost_type%3Dpage%26paged%3D1&action=edit&m=0&paged=1&post_author=1&post_parent=-1&page_template=-1&comment_status=&_status=-1&bulk_edit=Update&post_view=list&screen=edit-page&post%5B%5D=5&post%5B%5D=6&post%5B%5D=7&post%5B%5D=2&post%5B%5D=4&action2=-1

This is where the bulk action is processed, and where your output would go. But once the action is complete you’re redirected back to where you came from, so you won’t have any opportunity to see anything printed to the screen.

If you’re just trying to see if the action is being performed, try updating the posts whose IDs are passed with $post_ids, updating an option in the database, or sending an email. Printing stuff to the page isn’t going to be useful because you’re not going to see that page.