Title: Insert/edit link Class feature
Last modified: August 19, 2016

---

# Insert/edit link Class feature

 *  [Clicknathan](https://wordpress.org/support/users/clicknathan/)
 * (@clicknathan)
 * [17 years, 1 month ago](https://wordpress.org/support/topic/insertedit-link-class-feature/)
 * Does anyone know how you can control the various classes that are available under
   the Insert/edit link Class dropdown in Visual mode when editing a post / page?
 * I understand that I can create CSS to control these. What I’m asking is how can
   I control the list here? Is it possible or is this just a quirk or future feature
   thing?

Viewing 7 replies - 1 through 7 (of 7 total)

 *  [Andrew Ozz](https://wordpress.org/support/users/azaozz/)
 * (@azaozz)
 * [17 years ago](https://wordpress.org/support/topic/insertedit-link-class-feature/#post-1062894)
 * You will need to add the list of `Name to show=classname` to the TinyMCE config
   using the filter `tiny_mce_before_init`. [More info](http://wiki.moxiecode.com/index.php/TinyMCE:Configuration/theme_advanced_styles).
 *  [theinterned](https://wordpress.org/support/users/theinterned/)
 * (@theinterned)
 * [16 years, 12 months ago](https://wordpress.org/support/topic/insertedit-link-class-feature/#post-1062898)
 * I was having this problem for a long time, azaozz’s response helped me figure
   out what to do:
 * I couldn’t figure out how to add another css file to tinymce using the filter
   so I did a little digging and found that there is a file in **public/wp-includes/
   js/tinymce/** called** wordpress.css. **I added the classes I wanted to this 
   css file and they now show up in the post / page editor.
 * I don’t know how well this method will hold up to an upgrade (I have a feeling
   it wont), but I couldn’t find any information on the net about how to use the
   tiny_mce_before_init filter.
 * Ned
 *  [tomburr](https://wordpress.org/support/users/tomburr/)
 * (@tomburr)
 * [16 years, 7 months ago](https://wordpress.org/support/topic/insertedit-link-class-feature/#post-1062931)
 * Hi,
 * I am really struggling to figure this out. I don’t really want to edit a core
   file that might be changed in an update. Asaozz (or anyone else!), thank you 
   for your comment above, but please could you spell out in a little more detail
   how to add a custom class name to the class dropdown on the Insert/Edit link 
   dialog.
 * Many thanks!
 * Tom
 *  [TwoThirdsWater](https://wordpress.org/support/users/twothirdswater/)
 * (@twothirdswater)
 * [16 years, 7 months ago](https://wordpress.org/support/topic/insertedit-link-class-feature/#post-1062933)
 * I have exactly the same situation.
 * Can anybody help please?
 *  [Jandal](https://wordpress.org/support/users/jandal/)
 * (@jandal)
 * [16 years, 3 months ago](https://wordpress.org/support/topic/insertedit-link-class-feature/#post-1062945)
 * G’day,
 * I just found this plugin
    [http://www.n7studios.co.uk/2010/03/07/wordpress-insert-link-class-plugin/](http://www.n7studios.co.uk/2010/03/07/wordpress-insert-link-class-plugin/)
 * It adds class names to the editor, then all you have to do is add the class to
   your theme CSS.
 * Working like a charm for me.
 * HTH,
    =-)
 *  [divadrummer](https://wordpress.org/support/users/divadrummer/)
 * (@divadrummer)
 * [16 years, 2 months ago](https://wordpress.org/support/topic/insertedit-link-class-feature/#post-1062946)
 * The plugin above doesn’t seem to be working right now (it looks pretty new), 
   but depending on what you want to do, I found another nice plugin that might 
   work for you.
 * [http://wordpress.org/extend/plugins/link-indication/](http://wordpress.org/extend/plugins/link-indication/)
   
   Which allows you to automatically assign custom CSS classes for links based on
   file extension or domain.
 * I couldn’t find the TinyMCE file listed above, nor any other file that referenced
   the built-in classes.
 *  [kchevalier](https://wordpress.org/support/users/kchevalier/)
 * (@kchevalier)
 * [16 years, 1 month ago](https://wordpress.org/support/topic/insertedit-link-class-feature/#post-1062951)
 * Create a stylesheet in your theme directory called ‘tinymce.css’ (for example).
   Add your desired link classes in there, like so:
 * `a.myClass {}`
 * Then, in your functions.php add the following:
 *     ```
       function addTinyMCELinkClasses( $wp ) {
       	$wp .= ',' . get_bloginfo('stylesheet_directory') . '/tinymce.css';
       	return $wp;
       }
   
       if ( function_exists( 'add_filter' ) ) {
       	add_filter( 'mce_css', 'addTinyMCELinkClasses' );
       }
       ```
   
 * Hope that helps.

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Insert/edit link Class feature’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 7 replies
 * 8 participants
 * Last reply from: [kchevalier](https://wordpress.org/support/users/kchevalier/)
 * Last activity: [16 years, 1 month ago](https://wordpress.org/support/topic/insertedit-link-class-feature/#post-1062951)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
