How to link to us

Wouldn’t it be great if you could put a little box on your website which would let your users get in touch with their elected representatives? Well, you can!

Before you do so, make sure you read the guidelines for campaigners. You must not tell your users to send pre-written, identical letters — they are against our conditions of use and we will block them.

Envelope-style box

To add the envelope-style postcode box to your site, just copy the HTML code below into your own webpage.

<!-- WriteToThem envelope box, start -->
<script type="text/javascript">
   function clearDefault(el) {
     if (el.defaultValue==el.value) el.value = "";
   function fillDefault(el) {
     if (el.value=="") el.value = "Your Postcode";
<div style="width:167px;height:120px;
   background: url( no-repeat 0 0;
   font:9pt/11pt arial,helvetica,sans-serif;position:relative;">
   <form method="get" action="">
       <div style="padding:55px 0 0 20px;">
           <label for="pc" style="display:none;">
               Contact Your Politician
           <input type="text" value="Your Postcode" name="pc" size="13"
                   font:8pt/11pt arial,helvetica,sans-serif;color:#666;"
               onfocus="clearDefault(this)" onblur="fillDefault(this)" />
           <input type="image" value="Go" style="vertical-align:bottom;"
               src="" />
   <a href="" title="Visit"
<!-- WriteToThem envelope box, end-->

Conventional style box

Contact Your Politician
Enter your Postcode below:

To add the conventional postcode box to your site, copy the HTML code below into your own webpage.

<!-- WriteToThem conventional box, start -->
<div style="padding:0; border:1px solid #999999; width:14em; margin: 0;
           background-color:#FFE88C; font: 83% Helvetica, Arial, sans-serif;">
   <form method="get" action="" style="text-align:center">
       <div style="background-color:#D0BF69;padding:3px; color:#2B3260;">
               <strong>Contact Your Politician</strong>
       <div style="margin:0.5em; color:#2B3260; background-color: #ffe88c;">
           <div style="margin-bottom:0.25em;">Enter your Postcode below:</div>
           <input type="text" name="pc" size="13">
           <input type="submit" value="Go">
<!-- WriteToThem conventional box, end-->

Feel free to hack around with the design as much as you like. If you have any questions, just drop us a line.

Limiting to specific types of representative

If you only want to encourage people to write to one kind of representative - for example, only to their MP, link to WriteToThem using an address like this:

Or if you are using one of the boxes, above, to link to us, add this code to your form. It goes just after the postcode <input> field, and before the submit/go button one.

<input type="hidden" name="a" value="westminstermp">

Possible values for "a" in both cases are:

  • westminstermp — just your MP
  • council — all local government councillors (in some areas this will return district and county councillors, in others unitary authority councillors)
  • regionalmp — members of Scottish Parliament, Welsh Assembly, Northern Ireland Assembly, or London Assembly
  • mep — your MEPs (Members of European Parliament)

There are some more detailed three letter codes that you can use instead. Put these in a list as the value of "a", separated by commas ",".

  • District type councils: DIW – district council, LBW – London Borough
  • Unitary type councils: MTW – metropolitan district, UTW and UTE – Unitary authority, LGE – Local government district (Northern Ireland), COP – Council of the Isles (Scilly)
  • County councils: CED
  • London Assembly: LAC – constituency members, LAE – list members
  • Welsh Assembly: WAC – constituency members, WAE – list members
  • Scottish Parliament: SPC – constituency members, SPE – list members
  • Northern Ireland Assembly: NIE
  • House of Commons: WMC
  • European Parliament: EUR

So, for example, the link below would only show representatives of district type councils. For people entering postcodes in unitary areas, it would say there were no representatives of that type and offer to show them all their representatives:

<input type="hidden" name="a" value="DIW,LBW">

Pre-filling name and address

If you already know the name, address or email of the person using your website (ie if they are logged in) or reading your newsletter, you can send the values to WriteToThem.

Your supporters will be able to check or alter them before sending.

<input type="hidden" name="writer_email" value="name@email.address">

The fields available are:

  • writer_name
  • writer_address1
  • writer_address2
  • writer_town
  • writer_county
  • writer_email
  • writer_phone

Plugins for WordPress

Philip John (not affiliated to WriteToThem, but working voluntarily) has made a WordPress plugin.

It lets you add a WriteToThem form to your WordPress site as a standard WordPress widget - so it’s just drag-and-drop to install.

There is also a much older WordPress plugin, written by Richard Pope. To use that, you will need to alter your PHP template.

Please address support queries about these plug-ins to their authors, on the plug-ins’ pages.