1. Add `data-post_id` attribute to checkbox and fill it with corresponding post ID. 2. On click on `compare` button (link) retrieve all post ids from checked checkboxes with JavaScript (jQuery) 3. Redirect to the comparision page with post IDs in url as GET parameters. This is just one scenario how your task could be done. PS your question is not related to WordPress itself but is form field of web application architecture.