Add Link Capability to Select Dropdown

The below example uses WordPress Tags.


<select name="menu1" id="menu1">
	<option>Select a Tag</option>
	<?php $tags_array = get_tags( $args ); 
	$tags = get_tags();
	foreach ( $tags as $tag ) {
		$tag_link = get_tag_link( $tag->term_id ); ?>

		<option value="<?php echo $tag_link; ?>"><?php echo $tag->name; ?></option>
	<?php } ?>


<script type="text/javascript">
	document.getElementById("menu1").onchange = function() {
        if (this.selectedIndex!==0) {
            window.location.href = this.value;


Leave a Reply

katherine as a flat graphic icon

About Me

I’m an African / Ojibwe First Nations Web Developer living in Winnipeg, Manitoba.

Visit the Tips and Blog to see what I’m working on.