I want to show under each page, 6 random pages without showing the current page, how could I do this script?
Could it be done with a shortcode function?
There is also a field named Exclude IDs – you can add the ID of the home page in there.
You can get its ID by Right Click inspecting the Home Page in the live site. You will see something like page-id-123 which you would enter just 123 into the field.
Or you can see the same number by editing the Home Page and checking the URL.