Add client photo proofing to WordPress
Published Updated 3 min read
Photographers who need client proofing usually end up on Pixieset, Pic-Time or something like them. The monthly fee is fair for a busy studio and the experience is polished, but the client lands on a domain you do not own, your images sit on someone else's servers, and the workflow is whatever the platform decides to ship.
If you already run a WordPress site and need one proofing step inside it, a small plugin covers it. You build a session from images in your media library and send the client a private link. They heart the ones they want without logging in, press Submit, and you get an email with their picks while the link closes behind them.
It will not sell prints or run several revision rounds. If you need those, the commercial platforms earn their fee.
Why the gallery block cannot hold a selection
The block editor's gallery displays images and nothing more. A visitor has no way to mark one, and a heart toggle needs JavaScript that WordPress does not ship with the block.
Access is the harder part. A membership plugin gates pages behind a login form, but proofing needs the reverse: a page an anonymous visitor can open that is not publicly listed. That takes a token in the URL and a rewrite rule that catches the request before WordPress tries to serve a login page.
Then the picks need somewhere to live between page loads. Hearts sit in the browser's localStorage while the client is choosing, and move to post meta on the session when they submit.
A private link instead of a client account
Each proofing session is a post of its own type, visible in the admin but not public. It holds a title, a comma-separated list of attachment IDs, a notification address and a token. The token is a 32-character hex string from random_bytes, generated on first save and never changed, and the shareable URL appears in the session's settings panel.
Anyone with the URL can open the session. That is intended: the client has no WordPress account, so the link is the credential.
The rewrite rule maps /proof/{token} to a query variable, and the plugin catches the request at template_redirect, before any theme template runs. It looks up the proofing_session post with that token and renders its own page: no theme stylesheet, no header or footer, just the gallery. An unknown token or a closed session gets a short not-available message.
What the client sees, and what comes back to you
The client gets a grid with a heart on each image, a counter of how many they have picked, and tabs for All, Selected and Not Selected. Submitting sends the chosen attachment IDs to the server, which saves them to the session, closes it, and emails you the IDs with a link to the edit screen. The picks then show as thumbnails in the session's Submitted Selections panel.
Finding the attachment IDs
The Image IDs field takes attachment IDs, comma-separated. Each one is in the media library URL (?attachment_id=123) or in the file's detail panel. The session title becomes the heading the client sees, so name it for them.
A second round of selections is a new session with the same IDs. Nothing links the two, so a consistent naming convention in the title is what keeps rounds traceable across a project.
What you get
Included
- Proofing Session post type with image list and auto-generated token URL
- Client gallery with heart toggle, live counter, and All/Selected/Not Selected tabs
- Token-gated access: no WordPress account needed from the client side
- Submit action saves selections to post meta and sends an email notification
- Admin view of submitted selections with image thumbnails after submission
Not included
- Selling prints from selected images: no WooCommerce or payment integration
- Multiple revision rounds: each round requires a new Proofing Session post
- Galleries of more than roughly 200 images on a shared host: all images load at once with no lazy loading
- Per-image comments or annotations from the client
- Client accounts or session history: access is by token URL only
Questions
Can I use images from an external URL rather than the media library?
No. The plugin expects attachment IDs. Bring external images in with the media library's Add from URL option first, then read their IDs from the URL bar when you open each file.
What if the client closes the tab before submitting?
Each heart is saved to localStorage as it is clicked, so reopening the same link in the same browser brings the picks back. Clearing site data or switching device resets them. Two people on different devices will not see each other's picks either; if two people need to proof separately, give each their own session with the same image IDs.
Can I watch which images the client is picking before they submit?
Not in this build. Picks stay in the client's browser until Submit, then appear in the Submitted Selections panel. A follow-up message can add a live admin view that polls the session.
The client says the link shows 'session not available'. What is wrong?
The URL was copied incorrectly, the session was deleted, or the client has already submitted and the session is closed. Check the Proofing Sessions list. If it shows closed, create a new session with the same image IDs for a fresh round.
Build it in Steem
The button opens the builder with this guide's prompt filled in, so you can change anything before it runs. Nothing is built, and nothing is charged, until you send it.
Read the prompt (716 words)
Build a WordPress plugin called WP Client Proofing. Plugin Name: WP Client Proofing. Description: Lets photographers and designers share a private gallery with clients for image selection without requiring a WordPress login. Single PHP file. On activation call flush_rewrite_rules. Register a 'proofing_session' post type on init: labels with plural 'Proofing Sessions' and singular 'Proofing Session', public false, show_ui true, show_in_menu true, supports array('title'), menu_icon 'dashicons-format-gallery'. On save_post for proofing_session: verify a nonce. If wcp_token meta is empty, generate bin2hex(random_bytes(16)) and save it. Parse the posted wcp_images_raw field: explode(',', trimmed value), array_map intval, array_filter to remove zeros, array_values, json_encode, save to wcp_images. Save wcp_status: accept 'open' or 'closed', default 'open'. Save wcp_notify_email via sanitize_email. Add a meta box 'Session Settings' to the proofing_session edit screen (side context). Fields: 1) Textarea labeled 'Image IDs (comma-separated)' name wcp_images_raw, value = implode(',', json_decode(existing wcp_images, true) or empty array). 2) If the token exists: read-only text input labeled 'Shareable URL' showing esc_url(home_url('/proof/') . wcp_token). 3) Select labeled 'Status' name wcp_status, options 'open' (Open) and 'closed' (Closed). 4) Email input labeled 'Notify email' name wcp_notify_email. Include a nonce field. Add a second meta box 'Submitted Selections' to the proofing_session edit screen (normal, low priority). Show content only when wcp_status is 'closed'. Display wcp_submitted_at date string, then render each attachment ID from wcp_selections JSON as a thumbnail using wp_get_attachment_image(id, 'thumbnail'). Register a rewrite rule on init: add_rewrite_rule('^proof/([^/]+)/?$', 'index.php?wcp_token=$matches[1]', 'top'). Add 'wcp_token' to the query_vars filter. On template_redirect: if get_query_var('wcp_token') is non-empty, run the handler and exit. In the handler: query for a proofing_session post where meta key wcp_token equals the query var (WP_Query, post_type proofing_session, posts_per_page 1). If not found or wcp_status is not 'open', output a minimal HTML page saying 'This proofing session is not available.' and exit. Otherwise render the proofing page as a full HTML document. Inline CSS: *, *::before, *::after { box-sizing: border-box } body { font-family: -apple-system, BlinkMacSystemFont, sans-serif; margin: 0; background: #f5f5f5 } .container { max-width: 1000px; margin: 0 auto; padding: 1.5rem } h1 { font-size: 1.4rem; margin-bottom: 1rem } .toolbar { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem } .tab-btn { background: none; border: none; padding: .4rem .9rem; cursor: pointer; border-bottom: 2px solid transparent; font-size: .95rem } .tab-btn.active { border-bottom-color: #0073aa; font-weight: 600 } #counter { font-size: .95rem; color: #555 } .gallery { display: grid; grid-template-columns: repeat(auto-fill,minmax(180px,1fr)); gap: 1rem } .thumb { position: relative; background: #fff; border-radius: 4px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,.1) } .thumb img { width: 100%; display: block } .heart-btn { position: absolute; top: 6px; right: 6px; background: rgba(255,255,255,.85); border: none; border-radius: 50%; width: 32px; height: 32px; font-size: 1.1rem; cursor: pointer; display: flex; align-items: center; justify-content: center; color: #ccc } .thumb.selected .heart-btn { color: #e0245e } .submit-area { margin-top: 1.5rem } #submit-btn { background: #0073aa; color: #fff; border: none; padding: .75rem 2rem; font-size: 1rem; border-radius: 4px; cursor: pointer } #submit-btn:disabled { opacity: .5; cursor: default } #message { margin-top: 1rem; font-size: 1rem; color: #0073aa } Body: div.container containing h1 with session title; div.toolbar with three tab buttons (data-tab='all' text 'All', data-tab='selected' text 'Selected', data-tab='unselected' text 'Not selected', 'all' active); span#counter; div.gallery; div.submit-area with button#submit-btn 'Submit selection' and div#message. Gallery: decode wcp_images JSON. For each attachment ID get wp_get_attachment_image_url(id, 'medium'); skip if empty. Output div.thumb data-id=id containing img src=url alt='' and button.heart-btn containing the heart character. After the gallery output a script tag with: var wcpPostId = POST_ID_INT; var wcpAjax = 'ADMIN_AJAX_URL'; var wcpNonce = 'WP_CREATE_NONCE_wcp_submit'; (use intval for post ID, esc_js for the nonce and AJAX URL). Inline JS (same or second script tag): on DOMContentLoaded: const KEY='wcp_sel_'+wcpPostId; let selected=JSON.parse(localStorage.getItem(KEY)||'[]'); let currentTab='all'; function sync(){ document.querySelectorAll('.thumb').forEach(t=>{ const sel=selected.includes(t.dataset.id); t.classList.toggle('selected',sel); if(currentTab==='all')t.style.display=''; else if(currentTab==='selected')t.style.display=sel?'':'none'; else t.style.display=!sel?'':'none' }); document.getElementById('counter').textContent=selected.length+' selected' } document.querySelectorAll('.tab-btn').forEach(b=>b.addEventListener('click',()=>{ currentTab=b.dataset.tab; document.querySelectorAll('.tab-btn').forEach(x=>x.classList.toggle('active',x===b)); sync() })); document.querySelectorAll('.heart-btn').forEach(b=>b.addEventListener('click',()=>{ const id=b.closest('.thumb').dataset.id; const i=selected.indexOf(id); if(i>-1)selected.splice(i,1); else selected.push(id); localStorage.setItem(KEY,JSON.stringify(selected)); sync() })); document.getElementById('submit-btn').addEventListener('click',()=>{ const btn=document.getElementById('submit-btn'); if(!selected.length&&!confirm('Submit with no images selected?'))return; btn.disabled=true; const body=new URLSearchParams({action:'wcp_submit',post_id:wcpPostId,selections:selected.join(','),nonce:wcpNonce}); fetch(wcpAjax,{method:'POST',headers:{'Content-Type':'application/x-www-form-urlencoded'},body:body.toString()}).then(r=>r.json()).then(d=>{ if(d.success){document.getElementById('message').textContent='Thank you. Your selection has been submitted.';localStorage.removeItem(KEY)}else{btn.disabled=false;document.getElementById('message').textContent='Something went wrong. Please try again.'} }).catch(()=>{btn.disabled=false;document.getElementById('message').textContent='Something went wrong. Please try again.'}) }); sync(); Register wp_ajax_wcp_submit and wp_ajax_nopriv_wcp_submit to the same handler. Handler: check_ajax_referer('wcp_submit','nonce'). $post_id=absint($_POST['post_id']); if get_post_type($post_id)!=='proofing_session' or get_post_meta($post_id,'wcp_status',true)!=='open': wp_send_json_error() and return. $raw=sanitize_text_field($_POST['selections']??''); $ids=array_values(array_filter(array_map('absint',explode(',',$raw)))); update_post_meta($post_id,'wcp_selections',json_encode($ids)); update_post_meta($post_id,'wcp_submitted_at',current_time('mysql')); update_post_meta($post_id,'wcp_status','closed'); $notify=get_post_meta($post_id,'wcp_notify_email',true)?:get_option('admin_email'); $title=get_the_title($post_id); $link=admin_url('post.php?post='.$post_id.'&action=edit'); wp_mail($notify,'Client selection submitted: '.$title,'Selected image IDs: '.implode(', ',$ids)."\n\nView in admin: ".$link); wp_send_json_success(). At the end of the file: register_activation_hook(__FILE__,'flush_rewrite_rules'); add_action('init','wcp_init'); add_action('add_meta_boxes','wcp_add_meta_boxes'); add_action('save_post_proofing_session','wcp_save_meta'); add_action('template_redirect','wcp_handle_proof_url'); add_action('query_vars','wcp_add_query_vars'); add_action('wp_ajax_wcp_submit','wcp_handle_submit'); add_action('wp_ajax_nopriv_wcp_submit','wcp_handle_submit').
Steem